How to get the Grid Graph my RVOController/Seeker is currently on?

I’d like to know if a certain point is reachable from my current location on a grid graph. Sometimes, this point is outside the actual grid. I intend to check this by comparing it with the grid graph bounds using the Contains() function. How do I retrieve a reference to the said graph? Is there a better way of doing this?

Hi

You can get a reference to the grid graph using

var gg = AstarPath.active.astarData.gridGraph;

However what you might want is instead to reduce the A* Inspector -> Settings -> Max Nearest Node Distance. See http://arongranberg.com/astar/docs/class_astar_path.php#aa5b496fb1f393abb6896edc7777397b0

Also. The GridGraph.bounds field is unused and I will probably remove it in the next version because it is just a leftover field.

I see. Is there anyway of finding out if an arbitrary point is accessible through the GridGraph?

Hi

You can use

var node = AstarPath.active.GetNearest(somePoint, NNConstraint.None).node;

To get the nearest point to a node, you can check if it is walkable using

 if (node.Walkable) { ... }

and you can check if it is reachable from another node

 if (PathUtilities.IsPathPossible (someNode, someOtherNode)) { ... }