Animating Sprites in Unity

Lana Elfstrom
2 min readDec 23, 2022

Import a sprite sheet, which should contain all the different frames of animation to be used. A sprite sheet is a single image file that contains a collection of smaller images, or frames, arranged in a grid. Each frame represents a different pose or version of a sprite, and the sprite sheet allows you to quickly switch between these frames to create an animation.

Create a new Animator Controller by going to Assets > Create > Animator Controller. It will be used to control the animation of the sprite. Drag and drop the sprite sheet into the Scene view. In the Inspector panel, “Add Component” and select “Animator.” This will add an Animator component to the sprite, which will be used to play animations.

In the Animator Controller window, create a new state by right-clicking and selecting “Create State > Empty.” This state will represent a single frame of animation. To create an animation, click on the “Create” button in the Animator Controller window and select “Animation.” This will create an animation clip that can be edited in the Animation window.

In the Animation window, create keyframes by clicking on the “Record” button and then move or rotate sprite to a new position. Keyframes may be added to create the animation. To play the animation, use the Animator component’s “Play” function in a script, or use the Animator Controller to trigger the animation through transitions.

--

--