Endless Runner

I am creating an Endless Runner with corners. I made a character move along three lines. Implemented this by creating a point and adding a child actor to the main character. Divided into distances points. It turned out so…

I have a question. How can I save the line after the turn?

You’ve probably figured it out already but I’m gonna say it anyway.
Simply create an Int variable, set it to 1 and make sure your character always spawns in the middle line.
In your “Switch to Right line” function, make sure it’s only executed if your variable is <=2, then increment your variable’s value by 1.
In your “Switch to Left line” function, make sure it’s only executed if your variable is >=0, then decrement your variable’s value by 1.

There might be better ways to do this but you could get away with this until someone posts a better approach.

You don’t understand the problem. The problem is that after the player turns left, the character’s position on the road is knocked down. That is, he is no longer running in the middle of the road