That’s gotta hurt! — A quick guide to adding a damage VFX to a player

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 al for now.

--

--

--

Unity developer with a love of learning all things programming.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Ultimate Guide to Ecommerce UI/UX

Ecommerce UI/UX

The Nine Principles of UX Design Psychology: Can You Predict the Behavior of Your Users?

Let’s talk about the Brain — CXL Academy: Week 3 review

8 tips for running user interviews over the phone

How to Develop a Human-Centered Digital Transformation Strategy

How to Show Your Work When You Can’t Talk About Your Work

Design details: Kitchen Stories Recipes

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Luke Duckett

Luke Duckett

Unity developer with a love of learning all things programming.

More from Medium

Creating a SPA with Javascript: Adventures in Object Navigation

CS371p Spring 2022: Gautham Raju

WHAT IS SHANTI?

Introduction