- Home /
RigidBody.velocity incidence on NavMeshAgent movement capacity
Hello,
I have a NPC with a rigidbody. This NPC is controled by a script which make it move randomly in the world, detecting collisions, stopping, controling its environnement and turning to go elsewhere.
When the Player enter the "chase collider sphere", i activate the NavMeshAgent to chase (then destroy) the Player.
But to do my random patrol duty, i use rigidbody.velocity = transform.forward and to stop this patrol i use rigidbody.velocity = Vector3(0, 0, 0);
The script works if my NavMeshAgent is activated at the creation and chase the player. But once i stop the NPC or do my patrol duty (with transform.forward or 0,0,0), the navMeshAgent is totally unable to move the NPC.
Anyone encountered already this problem or have a clue ?
Thanks for your answer.
Best regards,
Your answer
![](https://koobas.hobune.stream/wayback/20220613081608im_/https://answers.unity.com/themes/thub/images/avi.jpg)