Adding Damage VFX to the Player

Rook Sullivan
1 min readMay 23, 2021

Now that the enemies are nice and explodey, Its time to add some battle damage to the player. This will give the player a visual representation when they have taken damage. To accomplish this, I added two new game objects under the Player in the hierarchy; Left and Right Engines. These will serve as a way to anchor the animation externally to the player object, and can be enabled via scripting when the player is damaged. The same animation is used for both objects, so once that was created on one I simply had to apply it to the other.

Using an if/elseif statement, I was able to enable battle damage at different breakpoints. If the player is undamaged, there is no change. If they take 1 point of damage, the Right Engine catches fire. If they take 2 damage, the Left Engine also catches fire. Once the player takes 3 damage they are destroyed and taken to the Game Over screen.

--

--

Rook Sullivan

Non-binary game dev sharing my experiences in Unity.