Simple toggle thrusters implementation

Let’s go over a quick implementation of how to toggle thrusters with the left-shift key.

Firstly, create the thrusters object and the animation of it following this article.

Open up the Player script and add a private GameObject for the thrusters object and a private variable for the increased speed:

Add a new function in which you enable the thrusters when left-shift is pushed down and disabled when released. Call this function from the Update function:

Lastly, add the thrusters object and set the speed on the script via the Inspector:

Good luck!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store