Damage VFX using Animated Sprites in Unity

Like our previous animation for the enemy lets add some animation our player when they are damaged.

Damaged Player

Like with our enemy ship animation we can add our sprites to the dope sheet like so:

Animation Dope sheet

We will name it right thruster and use the same animation and re name it left thruster. Once we have placed the thruster where we want it within our player we can hide the game object.

add our game objects to our player script then within our damage method we want to activate one of the thrusters when we lose a life then another then the player dies and the game is over. We can achieve this through and if statement.

If Else statement

If the player is down to 2 lives the right engine will show damage. Then when the player is down to 1 life the left engine will show damage before the player dies.

Aspiring Unity Developer