Unity Animation [02] - Animating a Player Character

Published: 22 October 2019
on channel: Zenva
7,636
53

ACCESS the FULL COURSE here: https://academy.zenva.com/product/uni...

TRANSCRIPT

Hey guys, welcome back. In this lesson we're going to look at the state machine itself and check out states and transitions. The state machine is what is responsible for determining when and where, we transition into and out of individual animation. So we're gonna check out what the actual state machine is, and kind of how it works and then look at individual states which are just in this case individual animations that the machine is responsible for determining when we go into these animations and we go out of those animations. So we have a walk animation. Remember walk, when does that walk animation become a run animation? Oh it becomes a run animation when going at this speed. But we don't want to just jump into that new animation, we wanna transition into it, we wanna blend into it, so it doesn't look like we abruptly started running. We want to kind of smoothly start running. And to do that, we're going to look at a few different things later on, but for now we're gonna look at transitions which is what allows us to define conditions to get from one animation or one state into another state. So let's check that out really quick in. Now we created our animated asset here, and that's what we're looking at, right here in this grid. Now if I hit Shift+Space, it will make everything that I had selected and focused on full screen so we can work in this, very nicely just like here. So what we have, first of all, are a few default states, or at least points that we can come into and go out of other states. And this whole grid represents an entire state machine itself. So any state, entry and exit. So what I want to look at here first, before we go over these, is I want to grab animation, bring it in here and then check out what the state looks like, as it is represented in this state machine. So I wanna go down and I wanna just go search in the search bar here. I know the standard assets comes with a bunch of nice animations and again, later on, we're gonna find some more third party animations to use. What I'm gonna do is say t:animation clip and that allows me to look at all of the animation clips and I'm going to, zoom out of this so we can actually read the words here. What I wanna do just to look at this, let's grab HumanoidWalk and I'll drag that in. Now notice we have a line coming from entry over to HumanoidWalk. And we'll get into that here in a second. And then maybe we'll have HumanoidRun as well, and drag that in. Now this one's gray and that one's orange. And we have a line coming from that one. So what's going on here? Is entry is the starting point of this state machine. It's where it comes from, to go into something else. To start the first state or to start the first animation. And now this one since it was the first animation I dragged in, is by default, the default starting active state. If I right click on this, we can see it is already set as the layer default state, which means this will be the first animation to play whenever the state machine is activated, which if we keep in mind here, whenever this animator is instantiated, Ethan the controller is active. So if I were to right click on this one and say set as layer default state, now that line goes from entry up to that. And this line will later on represent what a transition is. But for now, it's just saying, hey, you'll come from entry, which can be the path between a different state machine and this state machine. Or it can just be the starting point of the only state machine. Which in this case is exactly what it is. Now I could say we can come from any state, right click Make transition, go up to HumanoidRun. Which means I would come in from any other state and go straight into HumanoidRun. Or if nothing else is happening, this will be the default state that is activated. And that gives me a transition, which we'll get into here in a bit. But let's just delete that for now.


Watch video Unity Animation [02] - Animating a Player Character online without registration, duration hours minute second in high quality. This video was added by user Zenva 22 October 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,636 once and liked it 53 people.