

When you press the key start a timerproberty. so everytime it is over 200 the whole thing can happen. you need another timer that starts the same time as the sprinttimer but lets say you check it when it reaches 200. If you want a cooldown for the sprint it will be a little bit more complicated. as long as it is less than 100 the motinactuator will run with sprint speed.

Now what is happening here? the pressed key gives the timer the value 0 and the timer runs. Now you need a probertysensor that checks if the timer is less than 100 (again your time)Ĭombine it with a and controller and a motionactuator with the force for extra speed What does the combination do? it sets the timer to 0 one time for the time of 100 tics and after 100 tics another pressed key will do the same but not before the time is over change it to your time)Īnd you need a probertyactuator that sets the timer to 0 or toggles it (same effect) Write into the expressionfield timer>100 (100 is the time the timer shall run. you can check the timer by using an expressioncontroller. You need a keyboardsensor like the jumpsensor. create a timer, name it sprint and set it to any value higher than the time you want sprint to happen. The timed sprint you can do with a timer gameproberty. combine the keyboardsensor and the raysensor with an AND controller which is the usual controller and you will have a working jumporama. if you dont want this to happen, you got to use a raysensor that checks if the player is at the ground or any object you gave the gameproberty ground. but you will still be able to press the key while in air and give it another jump. this gives you one sensoraction per pressed key.
