Game Development Reference
In-Depth Information
Next, we will add the Physics Character Controller component instead of the Physics
Rigidbody . This Character Controller will give us the ability to access collision detecion as
the well as Move() funcion, which is very easy to use.
We will use the Move() funcion to move our character while
playing the animaion. This funcion can be accessed from the
CharacterController class when we add the Character
Controller component to our game object. The Move() funcion will
return the CollisionFlags , which will tell us which part of our
character hits other collider objects.
Then, we will apply the built-in third-person character controller script to our character, and
take a look at the script to get the basic idea for creaing the custom character control script
and camera.
Ater that we will get rid of the built-in script and start creaing the custom script to control
our character's walk, run, and jump by using the Move() funcion in the Character
Controller class. In this step, we will also create the transiion between each animaion
clip by using the Animation class in Unity, which allows us to adjust the speed of animaion
clip, type of playing, and fading ime. Next, we will create the camera script to follow our
character. We will then atach the script to our character and make it move on the level.
Why Is It Awesome?
Ater we complete this chapter, we will know how to set up the animaion clip from FBX
file, which we already exported from another 3D software. We will also be able to create a
custom controller script to control our character in the 3D world and blend the animaion
from idle to walk, walk to run and jump, and so on. We will also learn how to create the
third-person camera to follow our character.
This chapter will give you an understanding of how to create the third-person character
control script and you will be able to use it for other controllers.
Your Hotshot Objectives
Even though Unity is already provided with built-in third-person controller script, we will
create our third-person controller to get a good understanding of how to use the built-in
character controller. Here is what we will learn:
F Seing up character animaion and level
F Creaing character controller and built-in script
F Creaing a custom character control script
 
Search WWH ::




Custom Search