• News

• Industries

• Learning & Support

• Community

• Marketplace

# Choose Common

Hi . i have three blueprint actors that should chose randomize target point from an array of target points to move on there and the target point that was chose is deleted after a few delay time from the array and scene . but sometimes three of actors chose the same target point , after the first actor is reached to the common target point , that target point is deleted and the other actors was wandering. as regards the actors is copy of the same blueprint actor , and have the same blueprint node (same code).(goal is when the first actor chose one of the target points , the other actors dosen’t chose that) is there a solution to solving this problem?

Well, your post wasn’t very clear. But, if I understood correctly, you want that your actors don’t choose the same “target point”, right?

If that is the case, your problem is that you are using differents codes for the same results.

I mean, you can’t simultaneously choose a random value in your array for the three actors, because they don’t know that you don’t want repeteable values.

So you need use a simple code for give to all your actors differents target points. In this case I would choose the map blueprint and do the code there. When the first actor choose his target point, erase that value from array and continue (you could do a second array to save target points not allowed and compare them before asign them, but it will depend what are you doing).

Lets make an example.

Imagine a bag with 3 apples. Actors must choose one. The first chosen apple number 2, the second chosen appel number 2 and the third apple number 1.

That is a possible the result if you let them choose by themself.

But if you force them choose and take the apple in order, they will can’t repeat. Actor 1 is the first in the queue, he chosen 2. Actor 2 is the second, and now he can only choose between apple 1 and 3.

I guess you get the point by now