Day 19: Animating Sprites in Unity
Objective: Animate sprite objects.
To make the game a little bit more interesting to look at, we can add some animation to the power up. If you have a sprite sheet, animating can be really easy.
The first thing to do is verify you are on the object you want to animate.
Next is to open up the animation window. At the top of Unity go to Window -> Animation ->Animation
This window will come up, you can dock it any where you would like. I’ve docked it to the game area.
Verify that the object you want to animate is selected and click create in the animation window. You will need to save the animation somewhere and name it. I’ve named mine Triple_Shot_Powerup_anim.
Now that it’s save the animation window will change to this.
In your project area, take everything from your sprite sheet and drag it to this window. When done you will have a bunch of blue dots. The dots are each frame of the animation. You can hit play and see it work.
And that’s how you use Unity to create simple animations. What we did today will run on a continuous loop. If you don’t want it to loop, go to where you saved the animation and select the animation clip. In the Inspector area, you’ll see Loop Time, just uncheck that and it’ll stop looping.