To make the character’s speedÂ somethingÂ that canÂ varyÂ or change in-game, Create a variable named ‘speed’.
The speed variable is show below. Instead of moving 10 steps, the character will move “speed” steps.
- Maybe when a player has lower health he moves slower.
- Maybe when a player has a certain item he moves faster.
- Use a key to make the player run by increasing his speed when a key is pressed.