Hello, guys.
Now that you worked a bit with animations, I want to show you my video on explaining how the animator
works.
Exactly.
Let's watch it together.
All right, guys, We already have an idle animation and the run animation, but I want to take a step
aside and talk about animations in general and explain how the animator work in Unity.
So the animator in Unity works like a state machine.
And to give a good example, we can take a traffic light.
So traffic light has only three states in it and stop, wait and go based on three colors.
Right.
And traffic light cannot have two states working at the same time.
So if red state is on, then other two is off.
If you turn on green state, then other two is off.
Same with the animations.
We can play only one animation at a time.
Usually I guess it controlled by the timer or maybe some traffic police officer, but let's imagine
it controlled by the remote.
So whenever I press red button it shows me the red light and let's say it shows me the red light animation
when I press yellow and it shows me yellow, when I press green, it shows me green.
Very simple.
Now, in our case, let's imagine our traffic light is a player and player can wait in idle animation,
it can jump and it can run.
But I don't have remote for animations.
I have this C-sharp player controller script that I can use to control the animations in animator controller.
I hope that makes sense.
So this is what we're going to do.
We're going to use our player controller script as a remote controller for our animation.
Basically, in a summary, I can say that animator in Unity acts as a traffic light and script of the
player that controls animator component acts as a remote control the traffic light.
So let's get into it, see in the next video.