Implementing Player Thruster Boost

Tadd Olson
3 min readMay 10, 2024

--

First, we have our uncontrolled speed boost through the power-up system implementation. Adding VFX for a player to feel like they got a real buff!

Hyper speed activated!

Next let’s make it a controlled variable in the game with VFX! That way the player really feels like they are in control. Under the player in the hierarchy we need to add another game object using the thruster sprite giving it a title akin to the ever running fuel visual of your normal thruster.

Now edit it to the design you want in scene and the scale in the inspector. After which we need to make it inactive as to not cross visuals with your normal thruster sprite.

Add a [SerializeField] game object in code for system understanding.

Within the void Start we need to have the Thruster active while the player controlled thruster is deactivated. Player controlled boost needs to be first!

Using an if else statement after identifying the key we are going to be using for boosting. This way the computer understands that while the key is pressed to give the play a boost and when the key is not pressed to let off the gas.

As for the VFX, while the key is pressed the boost needs to be active while normal thruster is deactivated. Vice versa for when the key is not pressed.

Don’t forget to increase and decrease the player speed by the same amount so the player is not going haywire. Adding 5 but not taking 5 will just increase the player’s speed every time the key is pressed.

In the end you should end up with something like this:

Next on the list is making our shields stronger. Stay tuned!

--

--