Summary
In this chapter, we developed animation-triggering techniques introduced previously with the objective of creating an enemy that is both responsive and realistic.
We started by implementing range detection in an existing script to give the appearance of the enemy's response to the player.
We set up a simple waypoint system to allow the enemy to patrol the level.
By driving root motion with an animation curve, we connected to Mecanim on a deeper level and were able to better synchronize movement and animation.
Next, we elaborated on the enemy's attack and added the necessary code for it to be injured and killed, implementing the ragdoll effects that we created in Chapter 8, Implementing Ragdoll Physics.
Finally, we dealt with obstacle avoidance with Unity's potent navMesh system and coordinated the zombie's attack duration and time out.
In this book, we covered a few different techniques which Mecanim can be harnessed to create powerful and engaging character animation in Unity 5. I hope...