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

Identifying opportunities with Foodpanda mobile app

What Is a Component Library?

Patterns of the Exterior

A UX field study, but in real life

How to Design Inclusive Fintech products.

How we use Slack, Trello, TeamGantt, Illustrator, Photoshop and Zeplin for a design project.

How to Create an Effective Visual Elements Canvas for Your Data Visualization

How I paint a Motorcycle Tank

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

Doing Research With DRA

Automated Resume Screening: Robots messing our fate

World Peace Ramble 00

“Selling Uyghurs”: Rigorous Analysis or Strategic Disinformation?