AI movement by points from an array?


I have an array Actor with target point
I want the character to run first to the first point, then to the second, etc.
But since the array is quickly iterated over, undoing previous actions, it therefore only goes to the last one.

How to make it go first to the first point, and then to the second. In this case, there can be up to 1000 points, or rather an unknown number.

Sorry for English, translated by Google

On Russian Lang.

У меня есть массив Actor с target point
Я хочу чтобы персонаж бежал сначала к первой точке, потом ко второй и т.д
Но так как массив быстро перебирается, отменяя предыдущие действия, он поэтому идет только на последнию.

Как сделать чтобы он шёл сначала к первой точке, а потом ко второй. При этом точек может быть до 1000, а точнее неизвестное кол-во.

Извеняюсь за английский, переведенос с помощью гугла

You can make a ForEachDelay macro. Which does a for each loop, with a delay each time.

If you double click the for loop node, you can copy the code into your own macro ( DON’T edit the Epic code ).

image

OR:

3 Likes

Only go to the next target after the current target has been reached (i.e. reaching a target triggers moving to another target).
Same as @ClockworkOcean’s, but using events:

2 Likes

Thank you all very much, I didn’t even think about recursion…