In this lesson, we're going to look at actually putting this character on a path currently we have
animated the locator.
If we unmuted the locator animation by clicking on it in the channel box here and going down to unmuted
selected, you can see that indeed this person goes off into the distance in one direction.
All right.
So we could try to if we wanted them to maybe curve around and, you know, turn left or something like
that, we could try to animate that rotate and all that kind of stuff.
But what would be better and easier would be to actually attach this person to a motion path and then
we could control the path and instead of this locator by itself.
So let's do that.
Let's delete this animation.
So I'm just going to shift select here and.
Right.
Click and go to delete.
And I'm just selecting just because it's a little easier than, like, getting exactly on that key frame
and and deleting it that way.
So sometimes I just like this shift, select it.
So we need to create a path.
So let's go to the top view.
Spacebar left clicking on the middle.
Hopefully, you know how to do that by now.
We go over to the curves and I'm a click this little epi curve tool here.
And you can see it's also the icon selected here.
When I go over to the tools, actually, and I'm going to dock this, I don't know why it's not docked.
But again, all this stuff is, you know, you can move things around and it's not a big deal.
So Kubic is good because I want it to curve a little bit.
So I have four so I can see the grid kind of through this guy.
Hold on X so it'll snap to the grid while I left click to set the first point and I have them go straight
for a little bit so I'll hold on X and have them be on the grid again.
I'm going to set another point close to that because I don't want the curve to start out here.
I don't want to like round out when you do curve tool.
If I do that, you can see, you know, it starts to curve like this.
But if I was to set another point just in front of this one and then curve, well, it's going to get
a little wonky.
You kind of have to maybe put it a little further out and then do that.
Yeah, it gets a little wonky.
Basically.
It all depends on how extreme you make things.
So you definitely want to be careful about that.
So basically, I can make this, you know, go in circles and let's make him go out here and then go
another direction, truly, whatever we want it to do doesn't matter at all on it in order to save that
curve.
And now I'm going to attach the locator to this motion path here.
So I'm going to select the curve and turn off the tools here so we get a better screen area.
So I'm going to select on the channel box here so we can see what we have selected.
And I'm going to select this and I'm going to first delete all of the animation from this because it
needs to have clean channel box here so there's no keys on it and select the curve and I go to constrain.
Motion passed and attached to motion path cool so we can see that is not pointing in the right direction.
So let's undo that and open up this little option box here.
And we can see we have a few options here and want the front axis to be Z, not X.
That's what's kind of going sideways there.
So let's choose Z and we know what Z, because if you look in the bottom left here, we can see the
Z axis is the left or right, and we want it to go left to right to start because that's how the locators
oriented.
So now we can apply it should you go in the proper direction.
So I'm going to delete that.
Now, the only thing we have left to do is to get the correct type of translation based on based on
the length of our stride.
So if we go to frame 40, we know, you know, that's that's where our all of our animation ends.
That's where the cycle ends.
And that should be I think we had calculated thirty four units based on the distance of these two strides
back to back, I believe were eight and nine.
So that would be 17.
And there's two strides left and right, side B thirty four.
So this should be thirty four units to the right.
So let's create our own locator, go create locator.
It's to close this motion path menu down and now this new locator.
I'm just going to say thirty four so we can see that this locator is not in the correct spot where it
should be based on the speed that this person should be traveling based on the cycle.
So we can kind of see that, you know, the feet are sliding around and that doesn't make any sense
at all.
So what we can do is go to frame 40 where we know that this should be, you know, thirty four units
here, which is kind of the measuring, basically using this locator as a measuring stick here.
Right.
We want this to match up with this locator.
So let's go into our graph editor and space spacebar.
And it looks like I need to set up those panels again.
It's going to go to Layout's two panes, stacked two panels.
Panel graph editor.
And you can also see that the by default, the splines are kind of on a tangent, it's this little button
here and we want linnear because this character is moving at a constant rate with the walk cycle.
So I'm going to hit that.
And now I can see it actually goes way past where it should be.
So what I can do is just reduce this down so that those match up from scrapping the end keyframe here.
And if it's hard to get it on the exact spot, I can hit command and shift and I can zoom in here,
so the values are a lot smaller.
So when I shift middle mouse, drag this up or down, it's over much smaller values so I can get much
more precise movement in the graph.
Ed, when I scale this up like that.
Right.
So we can get it pretty much right where it should be.
So now we know whenever it goes across the motion path that it will be moving at the correct rate.
So it's moving at the correct rate and then it goes around this corner.
And the one goofy thing you have to look out for when you do especially tight turns like this is probably
wasn't the best example, the best example to use.
That's way too tight of a turn.
No one turns like that.
But, you know, it's good for education purposes.
You can see what the problems are.
Basically, the feet slide right there, just rotating around this center pivot.
So this is what's moving around.
So when the foot's out here, it's getting rotated around this pivot.
So the foot's going to slide out here.
So that's the only thing you have to look out for, for these motion paths.
But typically, you know, you're not using motion paths and this kind of crazy way.
You're using it in a very gentle, much more gentle way than I used it here.
So let's adjust it.
I'll grab the control vertex and we're going to run into another problem here.
I'll show you what the problem is in a minute.
It's going to drag all these points out and make this be a more gentle kind of a curvature to this turn
here.
And I'm going to get this point over here when I click this little isolation.
So I'm not going to I know I'm not moving it up or down vertically, and then I move these over.
So basically, we have this character walking in a circle now, but what if you noticed, was we changed
the length of this curve.
So what how motion paths work is they use a zero to one value.
So if we select a locator that's actually attached to this motion path and we go to the inputs over
here, we see motion path, we have a new value here.
All right.
So if we go to the graph editor and we can see this key frame over here, it's on frame two hundred.
We can also see it over here in the timeline.
If we go there, you can see that actually has a number associated with it, right?
It has the frame number is written on the on the motion path.
So it's going to stop right there.
Well, why is it stopping right there?
Well, because that's the key frame we have.
So if we were to you know, we have the rest of this curve, what if we wanted the character to go all
the way into the curve?
Well, basically, a motion path will say the beginning is zero and the end is one.
OK, so when we have the locator selected and we're looking at these values on the left side of the
graph here, we have zero down here and we have, let's see, like point eight here.
So point eight is correlating to the length of this curve.
So point eight, you know, of this curve, if it was zero to one, it beginning to end, point eight
would be right here.
So if we drag this up to point to one one point zero and we go to the end of the curve.
Right.
So the main takeaway here is if we change the distance of this curve, it will affect what that graph
is.
Right.
So it doesn't matter when it's at one, but let's say it wasn't at one.
Let's say we did want to end right here.
But then we change the length of the curve like, you know what, we want them to go further over here.
Watch.
He starts to move, right.
He slides because the length of the curve is changing.
So the zero to one value relative to the curve length is changing, too.
So you want to keep that in mind when you're using motion passed?
One way to keep that in mind and to always keep track of the proper length.
This is we're getting it.
This is an intermediate thing, but we've already gotten this far.
And I want to show you this.
This is a really cool trick, OK?
Not only not a lot of even experienced animators.
Now, this is something I I discovered and I've used on a lot of projects.
If we take an arc length so we can go to object mode, it's like the curve.
Let's go to create measure tools, say arc length tool.
OK, on the left click.
And you can see now we have this length we can see and left clicking.
It just gets stuck to this curve.
Right.
So where I drag it'll stay stuck on this curve.
But the number is changing because it's a measuring stick.
Basically it's saying this curve is, you know, two hundred and eighty units long.
OK, why is that important?
Because what I do if I'm going to put someone on a motion path, what I do, I make the motion path
crazy long.
I say, you know what, screw it.
We're going to go the motion is going to go way, way over here.
And the reason why I do that is that I want this value and change this background.
You can see the number.
So now let's say it's let's just go six hundred just for fun.
Right.
But I want this person to stop over here.
So what I'm going to do is, well, first I need to get the locator to.
Be accurate to the length of the cycle, so it needs to go way down.
Someone grab the end keyframe while I'm on the in the cycle, right.
I'm manipulating keyframe that I'm not actually viewing.
I'm on that frame.
That's the beauty graph editor.
Right.
So I'm going to drag this back to where it should be.
So the cycle is as the corrective.
The cycle is the correct length here as far as where the animation is.
And again, I'm I'm zooming in so that I can get a finer control here on where it's meeting up on the
most part.
So now I've set it right.
OK, I've set it to be where it should be for the cycle.
So when I play this back, the feet shouldn't slip.
And it's going to turn.
He's going to do a little turnaround.
He's going to stop right there.
OK.
So if we look at the curve now, remember when we were like point eight or whatever, you can see the
buffer curve up here where one is, look how far we had to drag it down because the length of the curve
is so long, right.
It goes to 600.
We pulled it all the way out here to 600.
So now the zero to one value and the graph editor is crazy.
You know, that relationship is way different now.
So we had to accommodate for that and pull this keyframe way down.
So it's on point to now, remember, we are on point eight.
That's on point two.
So it's all relative to the curve length.
OK, now here's the fun part, the tricky part that I, you know, hesitate to even teach because it's
more of an intermediate thing, just these concepts.
It's hard to it's hard to stop at a beginner level because it just kind of everything plays into it
into the next piece.
So we can see it says six hundred.
All right.
Now, let's say I've got everything set right.
The walk cycles working.
It's going at the right pace.
The feet aren't slipping too much.
I can fix these curved ones that are slipping later.
That's no big deal.
But later on we were like, you know what?
I want to change the path.
I want him to not turn all the way around.
So I'm going to go to the curve and added the curve ahead of the curve.
He's going to be over here now, but it's changing the length of the curve, even if just by a little
bit.
Right.
Well, how do we know it's changing the length of the curve and by how much?
Right.
Well, what do we have?
We have our fancy little arc length tool that we made over here.
Now we can see we went from six hundred to six hundred and fifty nine.
OK, so if we play this back, you can see on frame 40, he the two locators aren't matching up.
So we know that the feet are going to be sliding here.
Look, look at this.
Feet sliding.
Right, because now the curve is longer.
Well, gosh, OK, now you go back in and do the motion path curves in the graph editor and drag that
back down or what we can do and what we built instead of doing this now, instead of doing this, trying
to line that back up, what we can do is instead change the length of the curve.
And that's why I make it to be super, super long, because it gives me a ton of room to move it if
I decide to change this length over here.
So when I right.
Click this go to control vertex.
All I have to do now is bring this number back to six hundred.
Right.
That's where we set everything and we said everything's locked in and walk cycle works perfectly for
this motion path.
So I'm going to click and drag this and just watch the numbers go down.
It doesn't matter where this thing is, it could be over here.
Over there.
What matters is that number.
So we wanted to get it to about six hundred.
All right.
So when we go back over here and we're at six hundred, we've got a frame.
Forty.
Guess what?
Those locators match up and everything's fine now so we can edit this curved or our heart's content
as much as we want.
Drag this thing over here, drag this piece over here.
And instead of having to go back into the curves of the motion path and the graph editor, we can make
these adjustments to make sure that the walk cycle is moving along this path properly.
We can do that with this distance over here.
Look, look how much we drag it.
Nine hundred and whatever.
No big deal.
We just drag that back to six hundred.
To do I have to delete some points here just to be able to move to go past where I did this in a very
exaggerating way on purpose, so you can see the power of this right in that relationship between the
motion path and the length of the curve, not zero to one value and the length of the curve.
So you can edit the motion path zero to one value in the graph editor, or you can adjust the length
of the curve.
It's up to you.
And they will both get to the same issue here, which is we're trying to keep the feet from slipping.
They should be moving at a certain distance based on our animation of the walk cycle.
So I hope all that makes sense.
We kind of delved into a little more intermediate and really advanced animation techniques with motion
path and walk cycles.
But you know what?
You've watched hours of training.
And if you've made it this far, I think you're pretty advanced already.
So congratulations on making it this far in the course.
And I look forward to teaching you more in the next.
So and congrats on finishing this section.