- Home /
New NavMeshSurface setup only uses layers and doesn't care about Navigation Static
Hey everyone, I'm really confused. As you may know, there's a new-ish NavMesh workflow in town. You can find it here: https://github.com/Unity-Technologies/NavMeshComponents
This system is just fantastic. You can have many nav mesh surfaces, link them together, give links a width, give navmeshsurfaces different rotations (for climbing on walls and stuff.) The problem I have with it is it seems to only be able to bake based on layers, and doesn't allow you to use the Navigation Static option to control what gets baked and what doesn't. This seems like a gigantic problem for me. Doesn't that mean that I'll have to assign a layer to all "navigation static" objects whereas with the legacy workflow they could be whichever layer I wanted (for instance, the same layer as something dynamic might be?)
Is the system too new to have this, or is this the long-term plan for the workflow? Or am I just missing something that allows you to bake to navigation static instead of using layers?
Answer by WildMage · Nov 01, 2018 at 03:29 PM
I had the same issue. I edited the script NavMeshSurface.cs to only accept static meshes.
In the method List CollectSources () line 288, just before AppendModifierVolumes, add that:
#if UNITY_EDITOR
// My edit: only static objects
sources.RemoveAll ((x) => (x.component != null && x.component.gameObject.isStatic != true));
#endif
Your answer
Follow this Question
Related Questions
NavMeshPath.corners.length is always 0 1 Answer
Generate custom off mesh links in Navmesh bake? 0 Answers
NavMesh issue with spawning players 3 Answers
Navigation Mesh not working in build 0 Answers