How can I have my character move left or right by a fixed amount?

I have gone through a couple of the tutorials but can’t quite figure this out. I want to have my character jump left or right by a fixed amount. Instead of continuous motion, if the right input is pressed I want them to move laterally to the right by a fixed amount. Imagine if you were running down a train track and there is another track parallel, the only thing you could do is move back and forth between the to sets of tracks.

You should try the teleport node that is attached to you character movement controller.

I havent tested this, but in theory this will teleport you to a different place depending on the value of the movevector, which you can set on key press, or just make literal.

If you just want to directly move the actor, you can always simply add to their world offset directly. For example, below we use the actor rotation as the basis for a direct offset being added to the world position of a character as a result of keyboard input.

This may not be the visual look you’re going for, and I’d recommend looking into interpolation if you want to give a smooth transition.

Also, reading through the documentation on blueprints can really help with this sort of thing.

1 Like

Thank you. That was what I was looking for and even got me thinking about some other options. Much appreciated!!!