Damage VFX using Animated Sprites in Unity

Andrew Crippen
2 min readJun 4, 2021

--

In this article I will show how I setup the engine damage VFX for my player.

I started by dropping the first sprite of the player damage sprites onto my player, and then animated it as usual with the rest of the sprites.

I renamed the gameobject Right_Engine and moved it into the correct position on the player, I then duplicated it , renamed it Left_Engine and moved it into the correct position.

From here I set both GameObjects to inactive in the inspector.

Left_Engine and Right_Engine damage VFX gameobjects set to inactive

I could have made 2 variables in my Player script for the 2 engines but I went with a GameObject[] array and serialized it so they can be dropped into the inspector field.

In my Damage method when I subtract from Lives I run a switch statement to check how many Lives are left and enable the damage vfx on an engine when 2 or 1 Lives are left.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Andrew Crippen
Andrew Crippen

Written by Andrew Crippen

Unity Developer/C# Programmer for VR, 2d,3d Games and other Immersive Interactive Experiences

No responses yet

Write a response