Using Nav Mesh Agent to control playable character and mecanim

Hi there,

I was messing around over the weekend making a diablo style game where you click to move a character in third person. The issue I had was clicking somewhere like round a corner would result in the character getting stuck in a wall. I got around this by baking a nav mesh and using a nav mesh agent to move the character.

What I would like to know are:

  • Is it a good idea to use a nav mesh agent on a playable character?
  • Is it possible to get variables like speed out of the nav mesh agent to use in mecanim?
  • Would it be a better to create a separate script that controls things like speed instead of letting the nav mesh agent control this? and if so how?

Sorry for the long question.

Thanks

  1. See the stealth tutorial for some good advice.
  2. Unity - Scripting API: AI.NavMeshAgent.velocity
  3. You will need a script for the navmeshagent. Again the tutorial helps.

Brilliant thanks! Will take a look at this tonight