Retrace player`s path

Hello everybody,

I already used the search, but all I found was regarding future movements or AI pathways.

I would like to collect information about the route a player has taken. While doing so, the player should not see the functionality behind this [which means: not like Theseus ball of thread :slight_smile: ]

Best regards,

Aaron

Seems a pretty intensive operation but you could always store the players current position into an array. With each new coordinate you add the value to the array; this would need to be done on tick. Then, when you needed the character to move back then you just loop through the array backwards moving them to each saved coordinate and removing each coordinate as it uses it. A bool should be setup in the tick event to ensure it doesn’t overwrite the arrays values while its retracing its steps. Would be a pretty intensive operation especially for long paths but it should work. Also, a While loop would probably be the best one to use as you could ensure the player wasn’t moving (it has reached coordinate) before moving on to the next coordinate. May also want to use “Add Unique” when putting entries into the array.

If you were to go this route you can just record the player’s position every second or so and allow the movement component to move to the recorded positions in reverse.