I have two point graphs and want to seek only on the graph at index 1. I set “Traversable Graphs” on the seeker component to only this graph and I also set StartPath to use a bitmask.
Neither of these settings are having any affect on which graph is chosen. If I set it to “None”, it will error out so I know it’s evaluating the setting. Is there maybe an override somewhere I’m missing? I also upgraded to 4.2.17 yesterday so maybe that could be a factor?
seeker.StartPath(start, end, OnPathComplete, 1 << 1);
Are the two graphs connected?
The Seeker’s settings only affect how it searches for the graph to start/end on. If the two graphs are connected, it can still move into the other graph and then back to reach the end node.
I was just about to edit my post with that info. No, they are not connected in any way and do not overlap.
I’ve been flipping things on and off trying to find the problem and nothing is having any affect, except deleting the first graph. I thought maybe it was an execution order problem so I bound the path generation to a key and waited until the scene was fully loaded. Still no difference.
I’ve read all the graph mask posts here and I see this should be really simple so I’m at a total loss for now.
It really should be that simple… From what I can see, you are doing everything correctly. You don’t have any other scripts that are requesting paths?
Would you mind running
var nn = NNConstraint.Default;
nn.graphMask = 1 << 1;
var p = AstarPath.active.GetNearest(transform.position, nn).position;
Debug.DrawLine(transform.position, p, Color.red);
to just verify that it finds the correct graph?
That helped just enough to find the problem. A small handful of nodes in the Land graph were tagged as Ocean nodes, but they were grouped in with the other Ocean nodes. If the seeker found one of these nodes, it would lock onto the graph it was (wrongly) attached to. With almost 3,000 nodes to manage, I got careless.
I’ve been away from pathfinding for almost 6 months and trying to get back up to speed. I appreciate your help.
Great to hear you found it