Third person controller

From UMAWiki
Jump to: navigation, search

Unity's standard assets "Third Person Controller" can be added to an UMA to quickly create a controllable character.

1) Set up a scene with your UMA in it.

2) Import the "Characters" packaged from Assets->Import Package->Characters

3) Add a capsule collider to your UMA gameobject. UMA has the ability to add a capsule collider at runtime, but Unity's controller script caches the height value of the collider in it's start function before UMA can update it to the correct values. So lets set the correct values beforehand. It's center should be X: 0 Y: 1 Z: 0 Radius: 0.25 Height: 2

Capsule01.jpg

4) Now add, "Third person user control". This will also add "Third person character".

5) Let's increase the "ground check distance" in the "Third Person Character" script to 0.5.

6) Finally, to be able to move, the controller script relies on some parameters in the animator. By default, the UMA will load the "Locomotion" animator, but this does not have the necessary parameters.

Either, change the animator used to "ThirdPersonAnimatorController".

DefaultAnimator01.jpg

or add the parameters to the "Locomotion" animator.

AnimatorSettings01.jpg