So far the Recast Graph has been really useful, except it also creates NavMesh underneath a lot of the props we use to block out our level. We’ve tried a variety of settings but basically came to the conclusion that a custom script would be more efficient.
The script currently iterates over all nodes, checks which area they make up and indexes them according to that Area ID. When that is finished it checks which areas has the most nodes. We’re only interested in the one big NavMesh for our game. Everything else is irrelevant but we use quite a few NavMeshCuts and entities can get pushed out of bounds. We have enabled the setting so units will walk back to the nearest valid NavMesh and those tiny navmeshes are also valid so they get stuck.
Once everything is nice and filtered I check all nodes and if they don’t belong to the largest area then I set them as non-walkable.
Now in-editor this updates nicely. The nodes change colour to red. I then save this “Filtered Navmesh” through the normal AStar object in the scene without rescanning to keep the filtered version. Loading it also seems to work fine.
Yet when I start the game it simply sets all the nodes back to walkable again as if the filter was never applied. Do I need to modify the script to also handle saving when it is done with setting nodes as non-walkable or is something else causing the reset?
I know it’s possible to apply the filter when the game is running but it seems an unnecessary waste of resources.
Any help is appreciated.