Search code examples
c#unity-game-enginenavigationrotationnavmesh

UNITY3D: How do I Set NavMesh Agent Walking Speed to 0 but keep him rotatin towards the player


  1. I made a zombie with a Navmesh
  2. I made the zombie follow the player by agent.destination
  3. I made the zombie if close to target he will start attacking

-My question is how to stop the zombie from waking towards the player if he is in attack state but keep him rotating towards the player because if i set the navemesh agent speed to 0 he will stop rotating too.


Solution

  • I was trying to add a comment, but need more reputation for that. So had to make an "Answer" to reply.

    Are you using the same speed var to multiply with the speed of your zombie to also multiply the rotation with?

    If so, try adding a seperate var for the rotation speed.