- Home /
NavMesh area, walkable but not accessible.
Hi, I would like to know if the NavAgent is going in an not accessible NavMesh area because there is no continuity of NavMesh, but it is walkable.
if(MouseClickOnWalkable && AreaIsAccessible){
MyNavAgent.SetDestination(ThisTargetPosition);
......
No problem for "MouseClickOnWalkable" bool but I need to know "AreaIsAccessible" bool.
How you do?
Answer by HarshadK · May 18, 2015 at 05:43 AM
Look at the return value by this method. The documentation states that:
Returns
bool True if a path is found.
Description
Calculate a path between two points and store the resulting path.
This function can be used to plan a path ahead of time to avoid a delay in gameplay when the path is needed. Another use is to check if a target position is reachable before moving the agent.
Answer by WILEz1975 · May 19, 2015 at 04:43 AM
Thanks for the reply but I had already tried this solution. Even if the target point is located in a "detached area" of NavMesh, the result of NavMesh.CalculatePath is true.
Your answer
Follow this Question
Related Questions
Trouble with Navmesh Agent and Navmesh Obstacle 0 Answers
NavMeshAgent and NavMeshObstacle together, unit jumping a small distance on toggle 2 Answers
Is there a limit on how far a navmesh agent can go? 0 Answers
Getting a navmeshagent back on a navmesh. 1 Answer
SetDestination's and CalculatePath's Path State Return Works Too Late 1 Answer