How can get node using coordinate in layergridgraph?


#1

We want to apply the layergridgraph to the procedural voxel map we are creating. In layergridgraph, however, it is not possible to acquire nodes using world coordinate.

Is there a way to get this fast? Or should I change the array structure of the node?


#2

Hi

Could you elaborate on what you mean?

If you just want to get the closest node to a world coordinate then you can use AstarPath.active.GetNearest(point).
If you want to get the node using a grid coordinate then you can use LayerGridGraph.GetNode(x,z,layer).
See https://arongranberg.com/astar/docs/layergridgraph.html#GetNode2