Hey guys, and welcome to the first, in
the series of third person camera tutorials and Unity.
We're going to be using a combination of unities mecanium
system and uh, some camera scripts to create a
really compelling third person camera rig. It has a
lot of features that are sort of inspired by uh,
this tradition that was set by one of the
very first 3D games using a controller, which is
Mario 64. And this has got a lot of
cool features in it. It works differently from how
you'd expect actually. Mario is sort of runs
around the camera. He almost orbits it, which
is sort of unintuitive when you first look at
it, but that's what's happening when he runs backwards
and forwards. You can both face the camera and
run away from the camera. And finally, Mario
can sort of do this pivoting action when the direction
that you're moving is opposite to the camera direction.
There's also several other features involving this sort of free
cam mode, which you can see down here,
it's set as behind the back mode. This
idea of this third person camera was extended into Zelda 64
for video games like Majora's Mask and Ocarina of Time
because they were actually uh Ocarina of Time was
actually built on the same code base as Mario
64. So uh, that almost evolved into what
you see here at Wind Waker, which I think
is a really awesome camera rig. It's got a
lot of different modes and those include this sort of
behind the back mode here where Link runs as you
can see sort of in this orbiting fashion somewhat how
Mario did. You can run towards the camera and
that's something that Mario couldn't do. So you can
pivot and then keep running and keep leading the camera,
which is a nice feature. There's several modes
here. There's the first person mode where Link can
look around. He can't run while he's in this
mode, but he can definitely look around the world,
which is useful. There's this idea of targeting
which uses a different animation set and always stays behind
Link's back. So there's no more of that orbiting
business. And there's also a free camera mode which
is nice because you can sort of rotate it around
Link and he runs in relation to the direction that
the cameras facing. And this has got a nice
features, two of this sort of collision detection so
it doesn't clip through the walls. So as you
can see as I rotate around the wall, the
camera continues to look at Link and not clip through
geometry doesn't always work great, but it's way better
than clipping through stuff. And this idea of this
idea of not clipping through geometry also works if you
manage to position Link on the edge of something like
there. So this is also doing that collision detection
in the behind the back mode. So let's have
a look at all these features in the code that
we have implemented. This is the end product of
the tutorials. We've got this sort of test room
here where you can run around, we've got this
orbiting behavior and if you look on the scene view,
you can see that the cameras sitting in space
and the character is actually running around it, which
is exactly the behavior you wanted. Um You can
run forwards, you can run and pivot and run
towards the camera and that's taking advantage of mecanium.
There's the free camera mode which you can rotate around
the character, you can bump up close to them,
get far away and have the character run in
relation. We've got this idea of collision detection against the
wall, so if you zoom out and then that
is not quite as nice as the one in Zelda,
but it's not exactly professional programming behind it.
So it's about as good as we could do.
Uh, there's this idea of targeting where the camera
always stays behind the character, which is nice.
We don't use a separate animation set here, but
it gives the same idea. And instead of roll,
we've implemented just a simple jump animation so we
can jump if we need to get over some obstacles.
So this just is about it for the animations.
We've got the pivoting idea, which is nice
too. And we have pivoting from idle states as
well. So that's it. Let's get started with
the first implementation of the camera will build up to
this. Stay tuned.