Damage VFX using Animated Sprites in Unity
Day 26- Making 2D Space Shooter Game
Objective: To create a VFX effect when player is damaged by playing a animated sprite on player wings.
Let’s start by creating an animated sprite to use as a VFX for player hurt in the game.
After creating the animation, drag the animated sprite inside the player so it moves with respect to the player. Change the name to fit the theme like Player_Hurt_Right or something. Copy the animated sprite and move it to the left and rename it as well.
Then create a variable to store the two animated sprites.
Then create a condition where you are going to set your player hurt animated sprite as active when your player loses lives.
Finally set your animated sprites as inactive and then drag them in their respective variable in player script to let the game know which gameobject to set active when player loses lives.
If all the steps are done correctly then your VFX should play like this.