Download

[BEGINNER] Sprinting need help

Hey, I have been messing in UE4 for the last 3-4 hours and decided to make a movement system from scratch.

Now I got my sprinting button to work! :smiley:

But the problem is that i’m sprinting Left/Right/forward and back.

I only want to sprint moving forward while i’m holding the W key.

How would I do this? Im thinking to just link a key with the nodes to my sprint button.

I tried doing what you said, I’m not a expert on this. But now my sprint wont work at all lol. what did i do wrong? Do i still need to connect the Max walk speed to the Booleans or just remove them?

But then I wont have the speed I want.

Where are you actually moving the character at? If it were me, I would have the max walk speed permanently be the value of the running speed, and then only apply some of that if running is false. I have attached a picture of what I would do for the W key (MoveForward), and then for left, right, back, I would only apply the AxisValue * 0.6, since you can’t run those directions.

Wherever you are actually moving your character, you can check to see if the sprinting value is true, and apply a different value if it is (Like I am doing in the example). Does that make sense? There are better (more complex) ways of doing this, but this should work.

If you are unfamiliar with Axis mappings, they are kind of like your Sprint input mapping, except the AxisValue variable is set to 1 when the key is pressed, and 0 when it is not.