I’m using multiple recast graphs in a single level for different agent types. Per pathfinding graph I can configure a LayerMask so it filters out colliders, this works as expected. However, when I use the RecastMeshObj the GameObject always gets added to all pathfinding graphs, regardless of the GameObjects LayerMask.
I did a bit of digging and it looks like the RecastMeshGatherer.CollectRecastMeshObjs() does not filter on LayerMask. It looks like the RecastMeshGatherer already has support for LayerMasks and it does filter in eg. CollectColliderMeshes().
Could this same filtering also be added to CollectRecastMeshObjs?
Ah, but you just said if I add RecastMeshObj it will get added to both graphs, which is not what I want.
If I cannot use RecastMeshObj, what should I use to make it unwalkable?
If I do have to use RecastMeshObj to make it unwalkable, how do I make them end up in the correct graph?
Small update; if anyone runs into this problem in the future this is how I solved it.
In RecastMeshGatherer.cs line 176 and RecastMeshGathererBurst.cs line 427 (v4.3.60) add the following:
Thank you naimo, very helpful. @aron_granberg
An option for RecatMeshGatherer to ignore or respect layers when gathering RecastMeshObj would be really handy.