O'Reilly logo

Unity Character Animation with Mecanim by Jamie Dean

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Controlling Enemy Animation with AI and Triggers

In the last chapter, we looked at using ragdoll physics to add some realistic effects to our enemy death sequence.

In this chapter, we will build on the enemy AI that we began in Chapter 6, Talking Heads, creating three different behaviors for the enemy character within the game.

We will tackle the following aspects of the enemy AI:

  • Targeting the player with range detection
  • Making the enemy patrol
  • Controlling root movement curves
  • Attacking the player
  • Injuring the enemy and implementing the ragdoll effect
  • Obstacle detection and reaction
  • Implementing pathfinding with navMesh

Implementing range detection

Our work in Chapter 6, Talking Heads, left us with an enemy that becomes aware of the player on ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required