Increase Character speed the longer the character runs?

Hello. I am developing a 3D game where the character should get more speed the longer he runs(i.e. Sonic Adventure style) and eventually capping it at a certain value. Please give/show answers in Blueprints. Thank you.

1 Like

I put a video together that shows how to do this, Unreal Engine 4 Blueprints - Increasing Character movement speed while moving - YouTube

Assuming your Character is setup like the ThirdPersonCharacter in the ThirdPerson starter project, follow the instructions below.

You can create a “MoveForward” InputAxis event for moving forward and back. Bind the new “MoveForward” input axis event to keys W and S (or what ever you prefer), set W to value 1.0 and S to value -1.0.

Update your Character blueprint and modify the MoveForward InputAxis event. If the AxisValue is == 0 then get the “Character Movement” variable and set the Max Walking Speed to a default value.

Otherwise the Character is moving forward or back so calculate a movement speed how ever you would like. In my video I took the current Max Walking Speed and added a “Multiplier” value to it (yes i know, I didn’t actually multiply the multiplier by the Max Walking Speed and add the resulting value to Max Walking Speed). Clamp the final value between a minimum and maximum float value and return the clamped value.

Take the calculated movement speed and set the Max Walking Speed. The Add Movement Input node will work as usual with the exception that the Character’s walking speed increases gradually the longer you hold down W/S keys.

2 Likes