Animation

Animator Controller: Adding Transitions between states

You don’t have access to this lesson
Please register or sign in to access the course content.

In this lesson you will learn how to:

  • add an animation to a game object
  • use the animation controller
  • create transitions between animation states
  • add parameters to the animation controller

This tutorial will not cover switching between the states through code / scripting.

You will need[6] to know:

Open the Animator. Window > Animation > Animator

For convenience dock the Animator window somewhere you can easily access it.

Note that any animation clips that have been created are automatically added to the animator controller.

Note the arrow from the green entry state to the player_idle state.

This shows the default state that the animation will go to when the object is first loaded.

To create a transition from one state to another right click on the state to transition from.

Drag the arrow to the state to change to.

Note you will often need to have transitions in both directions to change to and from different states.

Set up all of the transitions.

Note that none of this will actually trigger the states to change.

To change the states we need to set some parameters.

Click the parameters tab in the animator

Click + to select the data type[1] of the variable[2] to

This example has three three boolean[3] parameters added.

Walk and dance are not selected. The Stand parameter[4] has been triggered.

Now we need to add conditions to switch[8] between states.

These are added on each transition arrow.

As these are triggers all you need to do is select the trigger that will cause the state to change from one to the other.

In the screenshot below the Dance trigger is to be run to transition the idle state to the player dance state.

Add the new input system to the project[9] and a player input component[5] to the player.

Add a Player Controller script to the player as well.

Terms definitions
2. variable. A placeholder for a piece of information that can change.
3. boolean. A data[15] type that can store two values, true/false, yes/no, 0/1, on/off, etc.
4. parameter. An extra piece of information passed to a function[12] to customize it for a specific need
5. component. The three strands of Technology in the NZC (Technological Practice[10], Technological Knowledge, and Nature of Technology) – together with the six specialist knowledge and skills strands for levels 6, 7, and 8) – support[13] the development of students’ technological literacy[11]. Each of these strands is broken down into smaller groupings (or substrands) called “components”. For […]
Terms definitions
1. data type. In this lesson you will learn how to: add an animation to a game objectuse the animation controllercreate transitions between animation statesadd parameters to the animation controller This tutorial will not cover switching between the states through code / scripting. You will need to know: how to create an animation with multiple animation clips attached […]
2. variable. In this lesson you will learn how to: add an animation to a game objectuse the animation controllercreate transitions between animation statesadd parameters to the animation controller This tutorial will not cover switching between the states through code / scripting. You will need to know: how to create an animation with multiple animation clips attached […]
3. boolean. In this lesson you will learn how to: add an animation to a game objectuse the animation controllercreate transitions between animation statesadd parameters to the animation controller This tutorial will not cover switching between the states through code / scripting. You will need to know: how to create an animation with multiple animation clips attached […]
4. parameter. In this lesson you will learn how to: add an animation to a game objectuse the animation controllercreate transitions between animation statesadd parameters to the animation controller This tutorial will not cover switching between the states through code / scripting. You will need to know: how to create an animation with multiple animation clips attached […]
5. component. In this lesson you will learn how to: add an animation to a game objectuse the animation controllercreate transitions between animation statesadd parameters to the animation controller This tutorial will not cover switching between the states through code / scripting. You will need to know: how to create an animation with multiple animation clips attached […]