How can I get a character to always move forward?

Trying to get the character to move forward or on a certain axis

Well since 4.4 you can lock the axis of an actor in the defaults section of the blueprint and then you can simply add a static number to the movement input to get the character to always move in a certain direction.

You shouldn’t need to lock the axis in most cases, though that is an option if appropriate for your game. If you’re using an Actor with the CharacterMovement component, this is very easy. In an endless runner type game, all you need to do is use an Add Movement Input node as Erasio mentions and give it a value in the desired axis in World Direction. For example, if you want to have your character move at a consistent rate of 1 along the X axis, it would look like this:

16677-endlesscharactermovement.png

You can give it a variable and feed that in to make it easier to tweak, and if you want to increase speed you can adjust the variable over tick and feed that in.

1 Like

If someone have the same problem as me, so can’t movement the character forward when the camera is looking down like that:

then just remove the Pitch node like here:

And that it!

thank you sir