Unity Development — Damage Effects

Christopher Graf
2 min readJun 4, 2021

--

When making a game you want as many aids as possible to convey important information to the player. It helps them to understand the situation in the game. You also never know who is playing. Someone who is deaf may appreciate the extra visuals to convey that damage has happened. There’s no harm and it looks cool.

Let’s add some awesome animation to show visual damage on the player. Once again, a necessary part of this will be to have an animation or visual to show damage based on your player. I am using a spaceship that has an engine blown out. Another example could be a person with a bandage on their arm or head.

For my engine blow out, I have an animation with some smoke and fire. I am going to make an object that has this animation as its default. That object is going to be a child of the player. Once there, it she be turned off in the inspector.

In the Player script, declare a serialized GameObject for your new damage object. Save the script and drag the object from the Hierarchy into its place in the Inspector. Back in the script, go to where you perform the code for player damage. In there, all you have to do is set the damage object active. Then it will appear in game. Make sure this is done when the player is not destroyed, but only damaged.

Take a look at the results.

Excellent! A new visual aid to let the player know damage has been done.

--

--

No responses yet