Finishing the Shield

Rook Sullivan
May 5, 2021

Putting the finishing touches on my Shield powerup was surprisingly easy, once I knew what to do. By assigning the Shield object to be a child of the Player object, rather than having it be an object that is instantiated through code, it will follow the player around without issue.

Next came turning the shield on and off depending on the powerup state. This was also made quite simple by having the Shield be a child of the player. By changing the SetActive component of the _shieldVisualizer object to either True or False, I could turn on and off the shield. All I had to do was set SetActive to True while the shield was on, and set it to False when it was disabled.

FF

--

--

Rook Sullivan

Non-binary game dev sharing my experiences in Unity.