GridGraph Areas

Is it possible to know if a character path passes through two different areas (identified with different colors because they aren’t connected) of a single Gridgraph?

If it is matter, I’m using the free version.
Thank you in advance.

Hi

A path cannot by definition pass through different areas because they are, as you say, not connected.
Could you elaborate a bit?

The path is calculated and it seems that exist a way to go from A to B, but the character and the path rightly stops near to the obstacles and cannot reach the other area, so I’m asking if there is a possibility to know if the path is kind of incomplete or something like that, considering the destination is not reachable.

I hope it’s more clear now.

Hi

You can do something like.

var node1 = AstarPath.active.GetNearest (a, NNConstriant.Default).node;
var node2 = AstarPath.active.GetNearest (b, NNConstriant.Default).node;
if (Pathfinding.Util.PathUtilities.IsPathPossible (node1, node2)) {
     // Do stuff
}