Getting nearest waypoints

HomeForumsA* Pathfinding ProjectBeginner QuestionsGetting nearest waypoints

This topic has 2 voices, contains 1 reply, and was last updated by  Aron Granberg 101 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
Author Posts
Author Posts
January 30, 2012 at 09:33 #1382

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?

February 7, 2012 at 18:50 #1453

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

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Getting nearest waypoints
Your information:






<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>