How do I gradually increase run speed of endless runner

I want to have the player’s run speed incrementally increase over time but stop incrementing after a certain speed. This is for an endless runner. I have looked up some tutorials, but I’m not sure what I am missing.

I am expecting to have my character start the game with a low run speed, and slowly increase the speed in order to make the game more challenging. The character’s speed will stop increasing once it reaches a max speed.

I have created a player variable for the incremental run speed called “Run_Acceleration”. I then created a new event to make this variable equal to the player’s run speed. Then I added an action to increase the run speed.
Then I added a sub condition to stop the incrementation of the run speed.

The tutorial I followed is a bit different from what I am doing. The tutorial was increasing the speed of objects coming towards the player, while in my case I have the player running through the level with a static camera. But this was the only tutorial I could find so it makes sense that it’s not working…

I am attatching some screenshots with what I did.

Thank you!

Modify the player’s max_speed of the platformer behaviour directly, and use a timer to set when the MaxSpeed is updated:

image

2 Likes

This worked! Thank you so much MrMen!

My character seems to pick up the speed a bit too soon. Can I ask what the “500” value is in the action within the “Change the maximum horizontal speed of player” is?
And which values within my player should I tweak around to check different speeds? Is it the “walk acceleration” in my player’s behaviors?

Thanks again!

If your character is picking up speed too soon, then change the value of the timer check to a larger number than 1 second.

The 500 is the maximum value that Max_Speed will get to. Another way of writing it is to use the clamp function (Clamp(Value, Min, Max)), so in your case Clamp(Player.PlatformerObject::MaxSpeed+1, 1, 500)

1 Like

Thank you for clarifying!

I will be playing around with these values.

Thanks again for the help!