Set character location to spawned actor in order

Try using the timeline’s Finished pin to reset the DoOnce node, maybe?

What do you mean exactly by “it is not working”?


So my goal is to spawn multiple actor and then move the charcter from its original position to the first actor created, then to the second one, then to the the third one and so on.

You can see I tried to do this with a “do once” node, but where ever I place this node it is not working.

If you could give me hint about the way to do this, it would be great.

It gives the same result.

Right now it goes to the first actor created, but once the character reach the first actor he doesn’t go to the second one. I believe because the destination variable has not been set again since I am spawning those actor too fast.

But if I move the DoOnce after setting the variable NewVar_2, then the character will directly go to the last actor spawned and ignore the other one.

You need the list of actors in an array first… :slight_smile:

Thank for the answer
I tried with the timeline and give the same result. Meaning it goes to the first actor spawned but ignore the following one. I guess because if the movement is not over, Ican not set the destination variable.

I tried with array. But how can I repeat the code and modified the destination?

Add each spawned actor to an array. Then loop over the array and lerp the player location to each actors location in the array.

Hi thanks for the answer. I tried to reply but my messages have never ben validated.

To Minimpoun I tried this but I got this error :

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_Array_Get_Item_2”. Blueprint: ThirdPersonCharacter Function: Execute Ubergraph Third Person Character Graph: EventGraph Node: SetActorLocation