Game Development Reference
In-Depth Information
First, we need a new parameter, which we will be able to access later from our character
controller script. So click on the
+
symbol as indicated in the parameter section of the an-
imation controller and add a new
Float
parameter called
speed
.
Now in the
Inspector
pane, change the
Exit Time
parameter by clicking on it and select-
ing the new
speed
parameter; give it a value of
0.1
. This tells the animator that when the
speed is greater than 0.1 units, it will transition from the idle state to the run state.
Next, repeat the process and add a transition from the
CharacterRun
state back to the
CharacterIdle
state, choosing the same parameter value; however, this time, set it to
Less
with a value of
0.1
, as shown in the following screenshot: