Visualizing shield strength with colour

--

Let’s go over the implementation of visualizing shield strength by changing the colour of the shield.

The shield was initially added to the space shooter in this article.

Open the Player script and add a private int for shield strength amount:

In the EnableShield function set colour and shield strength:

Lastly, add a switch statement to the DamagePlayer player function and change colour of the shield based on the amount of strength left:

Good luck!

--

--

Niklas Bergstrand
Niklas Bergstrand

No responses yet