Creating The Boss Fight! (Part 4: Health)
It’s kind of problematic if the big Boss is unkillable, right? Let’s add health to all its parts, so their destructable.

Today’s Objective: Add individual health to each of the different parts of the Boss.
I create a new “BossHealth” script, and add some variables. Since it should be a pretty simple script, I won’t make it into seperate classes for each part type.

The simple functions:

And the final function:

Now back in the Unity Editor, I’ll add this new component to all the different (destructible) parts of the Boss, i.e. The Main Body prefab, the Sentry prefab, and the Shield Generator prefab.
In my next post, I’ll be animating the Boss to move in certain ways during each phase of the fight (Generator, Sentry, and Main).