In the previous videos, I have configured the game with endless platform
generation, spike obstacles and the game experience looks very basic, the
character is always moving at the same speed. Many players could find that
gaming experience boring, so it is a good idea to speed up the game and
make it more exciting to play.
But how to make your game faster?
Go to player movement and add void on trigger enter. Write an if statement that will check if your player touches an object with a tag FasterSpeed. That will be the tag for the invisible game object. It will speed up the player every time the player goes through it. The speed will be increased by a float value which is called forceToAdd. That value updates the player force value, so the player will move faster. Save the script.
In the forceToAdd field, you need to set a value that will be added every time your player touches the invisible object.
As you can see, the player's speed value is increasing, but I would recommend you to add two objects with the same tag and move the platform generator further away, that will revert your player to the start position and make the game endless. You can also increase the size of the object so that the player cannot find a way to avoid the increasing speed object.
Support the Creator of Kozmobot on the social networks!
CHECK OUT MY WEBSITE: http://kozmobot.com
INSTAGRAM: / kozmobot.channel
TIKTOK: / kozmobot.channel