Game Development Reference
In-Depth Information
Connecting animation states
At the moment, our two states are not connected. So when we run the project, the hero is
always idle (lazy guy); let's change that.
To tell the controller to move between the two states, we need the following prerequisites:
• A transition link between the two states
• A parameter or event to activate the transition
• Something to change the value of that parameter, usually in a script
So, first we create the transition between the default idle state by right-clicking on the
CharacterIdle state and selecting Make Transition . This will change the mouse cursor
to an arrow. Then, click on the state we want to transition to, which in this case is the
CharacterRun state. Clicking on the new transition shows you the properties of that
transition in the inspector, as shown in the following screenshot:
As shown in the Inspector pane, at the lower-right corner, by default, the new transitions
are controlled by a single parameter called Exit Time , which simply means that when the
first animation ends, it will transition to the second. We don't want that here as we want to
control when the Run animation is activated.
Search WWH ::




Custom Search