- Home /
Question by
lorddanger · May 31, 2017 at 08:59 PM ·
movementnavmeshnavmeshagentdisable
New Way to stop navmesh Agent
Hello ,
NavemeshAgent.Stop();
Says that is Deprecated
NavMeshAgent agent = GetComponent<NavMeshAgent>();
if (dist != Mathf.Infinity && RemainingDistance < 2.5f)
{
agent.Stop();
Debug.Log("Reached");
}
So, What is there to replace it ?
Comment
agent.Stop(stopUpdates:true);
this has been deprecated while agent.Stop();
is the new way to stop Agent.
Best Answer
Answer by game4444 · Jun 01, 2017 at 12:01 PM
You can use NavMesh Agent. pause to stop and Resume to move again.
Why did this get chosen as the answer? There is no "pause" and Resume() has been deprecated.
I guess at that time Resume()
and Stop()
was still not deprecated, and it worked for the original question. Since then, Resume()
and Stop()
have been replaced with the isStopped
property.
Your answer
![](https://koobas.hobune.stream/wayback/20220612123224im_/https://answers.unity.com/themes/thub/images/avi.jpg)