Let's set everything up first:
- First, create a new Animator Controller using the Create button in the Project window, as shown in the following screenshot:
- Next, create a new default state called Wandering.
- Then, create a new state called Pursuing.
- Next, connect both states to each other, and back, with two transitions, as you'll see in the following screenshot:
- Now, we create two trigger parameters: Pursue and Wander, as shown in the following screenshot:
- Next, assign the Wander parameter to the set of conditions in ...