Keyframe animation is a great way of creating compelling interesting movement. And we might want to get our objects to respond to our interactions through keyframe animation. For example, we might have a whole bunch of animations. We might have carrot standing still, running away or eating. And what we need to do is know when to trigger which animation in response to different events. And we do this with something called a state machine. A state machine consists of a number of states. Each state is basically an animation. But the important thing is it also consists of transitions between states. So that is when you go from one state to another and each transition has a condition attached to it. So that's the thing that has to happen for that transition to happen. So, for example, if I'm standing still and I see a predator I might run away. On the other hand, if the predator is now out of range I might go about standing still. Same thing if I see some food or I'm hungry, I might go and eat and when I finished I might go about standing still. So a state machine is a bunch of animations with conditions for going from one thing to another. And those conditions are basically variables that we can set up in Unity and we'll see how to do that in practice in a minute. How does this work in terms of actual interaction with objects? So, for example we had a door. The door might start off closed, and when the player enters its collision area, enters and gets near the box it might transition to an animation which opens the door. And similarly, when the player leaves the conditioned box it will transition back to an animation that closes. So, what we have is animations that are actual actions, opening and closing the door and conditions which happen when we, which trigger those particular animations and as we'll see, it's possible to trigger those animations directly from player interactions.