A quick guide to adding a damage VFX to a player in Unity2D

Luke Duckett
2 min readApr 18, 2021

--

We are not going to go over animating sprites in this article, if you need a refresher see this article.

I have the following animation that we are going to child to our player and turn on and off as the player takes damage. We can attach one to each wing so we can show the player being in a critical state with one more damage to cause a game over.

We assign a reference to the left and right fireballs on the player script.

We can also create a function to pick which fireball to activate first so there is a bit of randomness to our game.

Now we just need to make sure the new function is called during our damage function.

And then we can test it.

There we go, a nice bit of visual feedback for the player when they take damage.

That’s all for now.

--

--

Luke Duckett
Luke Duckett

Written by Luke Duckett

🎮 First Nations Unity Dev from Wonnarua country 🏞️ | From Player to Lifelong Learner: Crafting Games, Debugging Code, and Embracing New Technology

No responses yet