A* Pathfinding Project

Some clarification with multiple graphs


I have a grid graph that my NPC’s use to walk around on. This is working great.

If I add a point graph, and set a tag of “Conveyor”. Can this point graph be used only for a conveyor belt? Or will my normal NPC’s try to use it as well?

Now furthermore, how do I set my NPC’s to only use either the Grid Graph, or the Point Graph?

I’d want my NPC’s to use the grid graph only, whereas products to use my conveyor (point graph) only. Is this doable?


@aron_granberg can I get some clarification please?



You can specify which graph an agent should use by passing an additional parameter to the seeker.StartPath method.
Since this is a relatively rare thing to have to do, it is not exposed in the Unity inspector.

// This is the index of the graph that you want to search on
// The first graph in the graphs list will be at index 0, the second one at index 1 and so forth.
int graphNumber = 2;
int graphMask = 1 << graphNumber;
seeker.StartPath(startPoint, endPoint, null, graphMask);

See also AI of different size in Recast Graph
See also https://arongranberg.com/astar/docs/class_seeker.php#ab50a876ab529ceb3eb9b97deb5a48d1e


Thanks man. I appreciate it.