Game Development Reference
var angleToTarget = Vector3. Angle(direction, this.
if(angleToTarget < 60 )
else if(angleToTarget < 80)
direction.y = 0;
this.transf orm.rotation = Quaternion.Slerp (transform.
Quaternion. LookRotation(direction), Time.
Step 14. Play. Note how the character turns around and the animations
change to better suit the height of the target.
For further in-depth examination of inverse kinematic systems in Unity,
download the locomotion project available from http://www.unity3d
3.7 Animation Management
In the preceding examples of 3D animations, character action sequences
were split into segments. In the case of 2D sprites, only one sequence was
given (walking); in the 3D examples, each action was contained in its own
It's not always the case that animations come to game developers in this
way. If you were to download a fully animated character from a site such as