Journal 17–2D Animation in Unity with Sprites
This exercise is to add our first 2D animation to one of the game objects, in this case it is a power up for triple shot lasers.
You will need some frames of animation to start. In this example, we have several images of the triple shot that changes colors. These images could be prepared in Photoshop or any other photo or image manipulation software.
In Unity, there are specific windows that we will need to access for Animation and the Animator.
In the Unity Animation window, make sure you have the powerup selected in the Hierarchy, and select “Create”.
You will be prompted to create an animation clip file. I created a separate folder for Animations. For the filename, consider including “_anim” or “_animation” as this will help keep all your project files clear.
Once the animation file is created, you need to record the animation. Click the red button to start recording. Note the timescale to the right.
Navigate to the animation image files, and select them all and drag them to the time scale. After that is complete, you can end the recording. Your animation is saved.
You can see the results by pressing the Play button.
Once you have recorded an animation, Unity will automatically create an Animator Controller file. You need to add this file to the Animation component on the powerup.
Once that is complete, you can see the results in game!
Thank you for stopping by!