Activate Multiple Set Actor Locations for One Key Press

On this image, I have several SetActorLocations. Within those SetActorLocations, I have a constant Y and Z value, while the X is changing.

I need to hit the up arrow key to send my pawn, to the first SetActorLocation.

Then when I press the up arrow key again, I need the pawn to be sent to the second SetActorLocation.

Same again for the rest of the SetActorLocations.

What I have set up in this image works, but only once.

I need to simply repeat the function, of the up arrow, sending my pawn to the second, third, fourth, etc… SetActorLocations, by pressing the Up arrow key.

I hope I was able to provide clear information for you. If you could guide me towards this end result, I would deeply appreciate that.

Any help would be greatly appreciated.

  1. Create an Vector Array and store your Locations in there
  2. Create an Integer variable
  3. Now when pressing “Up” check the Integer Value if it is higher than the lenghts of the Vector Array set Integer to 0
  4. Else get item of Vector Array, use the Integer Value for this
  5. Then call Set Actor location and give it the Vector
  6. Add 1 to the Integer

I will make you an screenshot this evening.

Something like this.

Julian that would be greatly appreciated! Thank you so much!

Hey, it would be nice to provide me some feedback whether this solution was helpful or not. Especially if it was, mark it as solved so that others may use it as a reference too.

Hey Julian, I do not have access to the computer with Unreal Engine on it right now, however, by tomorrow I will be able to test the Blueprints out. I will fill you in if there are any problems. If it works, I will most definitely mark it as solved so that others my use it as reference as well. Thank you for the help Julian, it is much appreciated! Talk to you soon.

IT WORKS! :smiley: Thank you Julian, I really appreciate it!!

Julian, the down arrow button action, which sends the pawn to its previous locations is not activating with these blueprints.

Instead of a space bar, like you have used, I used the up arrow key, which works in sending my pawn forward through my set locations.

I need the down arrow key to cycle the pawn in reverse through those specific locations.

I tried swapping the “Incrementint” node with the “Decrementint” node, which works up until when the pawn reaches its first location that I set.

Then it shoots me out into a random location in my scene, and I can only go forward from there.

Is there any way you can help me out with this function?

Hey, you are pretty close already!
After the “Decrementint” you have to check if it is “< 0”, if it is you have to “Set CurrentPositionNumber” to “Length of LocationArray” “- 1”.
That should be all. I will post a screenshot again this evening.

I have a similar problem, I want to bring these different actors to different worlds when they are selected. I can only send it to a single location, with the answer they showed above and I did not work.