- Home /
Question by
OneCode-Official · Jun 26, 2019 at 03:18 PM ·
navmeshnavmeshagentobstacle
How can i test if a path to an navmeshobstacle would be possible for a navmeshagent with agent.path.calculatepath?
I have some Navmeshobstacles with carving on. It is important to have carving on! I will calculate if it is possible to reach there position with agent.path.CalculatPath. The problem is that carving is on, so the navmeshagent returns false every time. I tried to do this:
building.GetComponent<NavMeshObstacle>().carving = false;
if (agent.CalculatePath(building.transform.position, agentpath))
{
AtackAbleBuildings.Add(building);
}
building.GetComponent<NavMeshObstacle>().carving = true;
This doesnt work so has any one else an idea how i could do it?
Comment
Your answer
Follow this Question
Related Questions
Trouble with Navmesh Agent and Navmesh Obstacle 0 Answers
Toggling NavMeshAgent and NavMeshObstacle 2 Answers
Navmesh carving causing issues upon enabling navmesh agent component 0 Answers
When a gameobject is destroyed a chunk of the navmesh gets destroyed 2 Answers
Way to ignore specific navmeshobstacles for specific navmeshagent when creating path? 0 Answers