 Hasan Bozok
|
Hi Aron.I’ve just purchased your A* pathfinding projects.What i want to do is this, i have some characters walking as a squad.The squad has a leader.I have two grid graphs.The squad leader use one of graphs to calculate the shortest path.Then squad leader should send some position according to number of squad units and these units takes those positions and calculate path for themselves in second grid graph.I could not manage to get nearest waypoints to the waypoints of squad leader.Is there a possibility to take all grid graph as a two dimensional array or smt?
|
 Aron Granberg
|
Hi
See this page in the docs for more information: http://arongranberg.com/astar/docs/calling-pathfinding.php#graph-data (at the bottom).
You can also get all nodes in a graph like this:
//using Pathfinding; //At the top of the script
GridGraph graph = AstarPath.active.gridGraph; //Shortcut to the first grid graph in the scene
Node[] nodes = graph.nodes;
//The above contains all grid nodes laid out row by row in increasing x and y coordinates
|