Road TO Dev — Making our shield work and seeing it!
Ok now we have the powerup setup let’s make our shield work and have it be shown visually. First we need to create the shield object and set is as a child on the player. We will want to set it’s active to off as well.
With that set we need to create a handle for the player to know what it is and setup our bool to activate it! I’ve already shown how to attach objects in the inspector so you should already be familiar with that.
We are going to need a method for the powerup script to communicate to as well.
Once that is done we can create our shield code. This is pretty easy we just tell our player not to take away lives is the shield is active.
With this setup we will have our shields activate once and then be done but we still don’t have our visual showing up. To do that we just need to activate the shield object at the right time and deactivate when it’s off.
Finally just make sure to setup the powerup script to actually trigger the shield method.
With all that setup we should be set to get and see our shield!