Function GridGraph.GetNode
GetNode
(int x, int z)
Node in the specified cell.
Public
GridNodeBase GetNode (
int | x | |
int | z |
Node in the specified cell.
Returns null if the coordinate is outside the grid.
var gg = AstarPath.active.data.gridGraph;
If you know the coordinate is inside the grid and you are looking to maximize performance then you can look up the node in the internal array directly which is slightly faster.
int x = 5;
int z = 8;
GridNodeBase node = gg.GetNode(x, z);
See