Damage VFX using Animated Sprites in Unity

Now the game will display an animation each time the player is touched by an enemy

  • Create an engine animation
  • Rename the sprite in hierarchy to LeftEngineDamage
  • Duplicate and rename to RightEngineDamage
  • Place both as children in Player gameobject
  • Place the Left and Right Engine damage gameobjects in a good place in player. Set their scale as desired.
  • In the player script, create a reference for both gameobjects
  • Deactivate them in Start ( )
  • Activate LeftEngineDamage if lives == 2 and RightEngineDamage if lives == 1

Result: