Unity VFX: Damage using Animated Sprites in Unity

When designing a game or a simulation, we try to reflect reality in a certain way, to preserve the laws of physics and to reproduce the behavior of individual elements on events. For example, in the game Space Shooter one of the important behaviors will be the explosion of enemy ships shot down, or the increasing destruction of our ship under the impact of the attack or collision with asteroids.

We can simulate the destruction of our ship by destroying the engines. With the loss of one life, the right engine begins to smoke and burn, with the loss of the second life the left engine begins to refuse service.

We need one animation, two objects and some code. First we create 2 objects visualizing the burning engine.

Then we deactivate these 2 objects and in the script, using the conditions, when one life is lost, we activate the first object that visualizes the damage, and when the second life is lost, we activate the second object.

Now our game is closer to reality. While in games we can freely break the laws of physics and create our individual game mechanics, in simulations we must stick to the rules of the Earth.

Hi, I’m Damian, a Unity Software Engineer who loves building education and simulation games.