-1
  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.

1 Answers1

0

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.

gustafrydell
  • 10
  • 1
  • 3
  • I'm not using any vars to walk or to rotate im using only the navmesh agent.destination= player.transform. this functiontion will rotate and do everything itself. – Nassim Hamza Jun 09 '21 at 14:35
  • https://answers.unity.com/questions/540120/how-do-you-update-navmesh-rotation-after-stopping.html I found this answer. Hope it helps. – gustafrydell Jun 09 '21 at 14:50