Animating Damage on Sprites — Tracking Damage in Unity
Currently in my 2D example game, the player has a lives tracker, but we can expand upon the system by adding visual feedback to the player’s model when they are “damaged”.
I added two new children to the player object, one on each wing with this visual. They are disabled by default.
In order to add them as we take damage, we need to add both of these gameobjects as variables.
And finally, we need to check the damage state whenever the player takes damage, and enable the correct objects!
Let’s see it in action!