endless runner game switching lanes smoother

Hello guys i created an endless runner game and i want to improve the switching lanes action trying to make it smoother anyone knows how?

It might not be the best solution but I can think of two ways that you can do this.
You might want to make you character stationary and move the world towards your character and set your character’s location mixed with a timeline node so it smoothly transitions lanes.
Other way is that you can set a constant move forward and get movement input from your character with a boolean which stops registering left or right movement when your character reaches certain Y location.
Or adding timeline node to your current setup might help smoothing the transition.
Having it directly switch lanes might give you a hard time setting up animations rather than giving it the freedom to move in a range, but it’s doable.

i saw a youtuber had the same “issue” with me and he fix it by adding timeline node but i he had another blueprint set up so i dont know where to add it on mine!

I made this as an example in player character blueprint. You might be able to set lane locations and numbers with “switch on int” node too.
You’ll need to add animation to this example for each input to make it look natural. For that “blend poses by bool” in your animation blueprint might be a suitable approach or you might find a better way to do it considering your needs.
Also you can add constant forward movement by event tick (instead of existing manual input) or make a custom event and call it in a fixed delay.
But having your character move this way could potentially get messed up by collisions which you can find solutions for it after you decide which route you want to go.

You can use my example (minus the event tick for forward movement) instead of your second screen shot.
Also instead of playing animation you might get your desired results using a second timeline track for rotation like this:

You can also use “set actor location and rotation” node instead of two separate nodes.

1 Like