Player animations - Part 2 (Setting up the Animator)

2D Game Design with Unity

🕑 This lesson will take about 9 minutes

In this lesson, you will learn how to configure the transitions between different 2D animations for the player GameObject (eg. idle, walk, jump) in Unity using the Animator. In the next lesson, we will look at how to control when these animations play with C# code.

These are the three steps involved in creating player animations:

  1. Create each of the player animations (previous lesson)

  2. Configure the animations in the Animator (this lesson)

  3. Control when the animations play with C# code (next lesson)

This lesson, we will focus on using the Animator in Unity. The Animator allows you to specify which animation plays first (default state) and when and how the game should transition between the different animations (eg. transitioning from the idle animation to the walk or jump animations). This is achieved by drawing paths between each animation in the Animator and then specifying how these transitions between animations occur, as shown below.

Screenshot of the Animator in Unity and transitions between each of the different animations (idle, walk, jump)

Game art, tiles and sprites from the Free Pixel Space Platform pack are used in this lesson video and can be downloaded from the Unity Asset Store.

Watch the video below for the step-by-step demonstration.

Is YouTube blocked at school? Watch on Google Drive.

Next lesson: Player animations - Part 3 (Coding the player animations)