Get Path on specific Graph

Hello, basically I just want to circumvent the GraphMask, which is “limited” to 31 unique graphs. Is there an easy way to do it?

I am using a server where all maps are loaded at once, each map having a graph attached to them. The problem is, that those graphs overlap and without specifing a graph which should be used by the seeker (depending on the map they are on) a seeker on map 1 could in theory find a path on map 2, which they should not.

The GraphMask would obviously work with this, but I don’t like the limit of the bitmask, since I’m having only one graph per map anyway there will never be a reason to have a seeker try multiple graphs.

If there is no easy solution to this, I’d probably still go with the GraphMask anyway, it just would be nice to have that option. :slight_smile:


You can subclass the PathNNConstraint class and override the SuitableGraph method.
Then you can pass it to both the AstarPath.GetNearest function and also assign it to Path.nnConstraint if you want to use it for a path calculation.

1 Like

Thanks for your quick help!
That was easier than I expected. :smiley: