Player Animation Controller
To create a new Animation Controller right-click on the Assets folder in the project, select the Create option, and then select Animation Controller from the list:

Rename the file to dudeAC and double-click on it:

When you double-click on it, a new panel will open up called Animation, as shown in the following screenshot:

The Animation Controller basically controls the flow of the animation. There are three states that are added in by default; these are Entry, Any State, and Exit:
- The
Entrystate specifies which animation will be played at the start of the scene. So, in most cases the first animation that gets played is the idle animation. - The
Any Statespecifies which animation needs to be executed irrespective of the previous animation that is being played. - The
Exitstate is the animation that is played at the exit of the scene.
Let's set up the states for the player, which will be the same setup for the enemy as well.
First, we will create the default animation so...