Journal 17–2D Animation in Unity with Sprites

Chris Nielsen
3 min readMay 1, 2021

--

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.

Unity Powerup game object

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.

Unity Window

In the Unity Animation window, make sure you have the powerup selected in the Hierarchy, and select “Create”.

Unity Animation Window

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.

Animation clip, save as window

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.

Unity Animation window, start recording

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.

Unity Animation, add image files to create animation

You can see the results by pressing the Play button.

Unity Animation test

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.

Unity Animator window, and update to Animation component

Once that is complete, you can see the results in game!

Unity Playmode with power up animation added

Thank you for stopping by!

--

--

Chris Nielsen
Chris Nielsen

Written by Chris Nielsen

An Engineering Manager consultant who is seeking additional skills using Unity 3D for game and application development.

No responses yet