- Home /
NavMeshObstacle carving hole not disappear?
hi there. i'm add a NavMeshObstacle to my player which is already has a NavMeshAgent component.
I know that can not attach Agent and Obstacle on same Object.so .once my player reached it's destination ,i made Agent disabled and Obstacle enabled . but there comes a problem :when i re-Disable Obstacle and re-Enable Agent in order to move my player then my player joggled maybe one frame.seems the hole carved by Obstacle didn't disappear immediately after disabled Obstacle.
So i wonder what is the exact time the NavMesh system restore the hole carved by Obstacle and how i supposed to do.
NavMeshAgent navAgent;
NavMeshObstacle proxyAgent;
void Start()
{
proxyAgent.enable=true;
navAgent.enable=false;
}
void Update()
{
if(Input.GetMouseButtonDown(0))
{
proxyAgent.enable=false;
navAgent.enable=true;
navAgent.SetDestination(some vector3);
}
}
Answer by waizui · Apr 02, 2019 at 04:13 AM
Update
ind some inefficient solution. but works well so far . if anybody need it just reply i'll update
Your answer
![](https://koobas.hobune.stream/wayback/20220612194650im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
OffMesh Link and NavMesh Obstacle 1 Answer
Navmesh Bridges 0 Answers
Painted trees are not acting as obstacles on navmesh 0 Answers
enable/disable navmesh agent and obstacle same object (player) 0 Answers
Unity NavMesh obstacle avoidance? 0 Answers