Day 20 of my Developer Journey: Shield visualizer

Objective: Create a shield sprite that follows the player and can be activated or deactivated depending on if shields are on or off

This is rather simple. First, we will take the shields sprite and make it a child of the player.

The shield is now a child of the player

Now we will add a variable reference to the shields as an object.

The shields will now be a game object

Next we will use the .SetActive command to toggle the object on and off.

Shields will toggle on
Shields will toggle off

In the inspector assign the sprite to the _shieldsVisualizer for the player and you are set!

Our sprite is now assigned to the game object

Objective: COMPLETED

--

--