In this article, we will demonstrate how to visual damage to a 2d spacecraft. The first step is to create a game object to hold our damage simulation.
By dragging the first frame of the animation clip we generate a “Transform” with a “Sprite Renderer” component.
Next, we open the Animation Window and “dock it” next to the “Game” tab. Then select our newly created “Player Damaged” GameObject and click on the “Create” button.
I selected the name “Player_Damaged_anim”. We are now ready to create our animation.
Now that we have an animation we can run it in the “Animation Window”
Looks good, lets put it on our player and see how it looks.
Looks a little too large. Let's scale it down a little.
Scaling it down to .5 on the X, Y, and Z did the trick.
by making our “Player Damaged” game object a child of “Player” it will move with the “Player” so when we want it displayed, we simply turn it on in code.
In Part 2 we will create the C# scripts to control our damage animations…Until then…