Very slow NavMesh baking with multiple terrains
Hey there guys!
Lately I came in a slight obstacle while working on my game. The game world is divided into 12 smaller (500x500) terrain game objects and filled with various buildings, environment stuff etc. Lately navmesh generation takes too long (10-12 hours) making my development and testing process a real pain. I tried testing things out looking what could be the source of problem, and I came to conclusion that if 4 or less terrain objects are active, navmesh generates in matter of seconds, while if there are 5 or more terrain objects baking takes forever.
What could be the possible solution for the problem? What if I create one big terrain (6000x6000), would it be performance and speed wise? Thank you for your time taking to answer my question.
Having exactly same issue. Tiled terrains just freeze when start baking if more than 4-5 terrains enabled at the same time. Doesn't even progress to "exporting tiles". Left overnight to test if was just being impatient. 12 hours later still hung trying to bake 9 tiles. Unity5.6 personal running on $$anonymous$$ac. EDIT: Dropped terrain tile heightmap res to 2048 from 4096 and it allowed a few more tiles to be baked, but still not enough to bake my 7x7 terrain without crashing. Aargh!
Answer by Shack-Studio · Jun 12, 2017 at 12:55 PM
Perhaps setting your terrains to be neighbors would magically fix it?
https://docs.unity3d.com/ScriptReference/Terrain.SetNeighbors.html
Usually that just fixes the LOD connections when you move far away from the terrain but maybe it helps the Navmesh baking too.