Dynamic Levels & Navmesh

I’m creating a level by placing prefabs side-by-side (e.g. making a long hallway with a series of floor objects). However, this is being done dynamically… the level is only built at runtime.

I was hoping to use Unity’s pathfinding - the prefabs could still be marked NavMesh Static, because they won’t move after the initial placement - but it looks like NavMesh can only be baked into the scene, not attached to a prefab. Is Unity’s NavMesh even a possibility for me here? If not, are there recommended pathfinding solutions for dynamic levels on the Asset Store? Or do I just have to figure out my own custom pathfinding solution?

Hey guys, I found a workaround to this proble, in the last post on this thread:

http://forum.unity3d.com/threads/122545-Problem-with-NavMesh-and-Asynchronous-load

You need to save your navmesh prefab in a scene by itself, then load it in (non additive), but set the game objects in your scene to “Dont destory on load”.

Its kinda hacky but it works for now. But overall, I really wish Unity would extend the NavMesh features.

Same problem cropped up for us. But nobody will read this who works at unity.

I have exactly the same problem :/.
I can’t understand why it’s not possible to prefab the Navmesh to reuse it! It’s like a basic feature to me.
The lightmap baking is working fine with prefabs so I expected that the Navmesh baking was at least working the same way !

In fact, I have to revert back to previous solutions like
http://angryant.com/path/

I hope that Unity 4 will enable that feature.

same problem exists with unity 4. ridiculous.

Gah. Hoped they fixed it… Well, they have to force us pay money for assets right?
So go and buy Aron’s asset for $100 :-/

I got another work-around which was way more simple for me. I had to create a Scene with the whole NavMesh.

I already had my whole map subdivided in a couple of sections but since the world was big, i didn’t want all of them in one scene.
So i created a scene in which i put my WHOLE map.
Then I baked the map. After that, i deleted the WHOLE map, but there was still the baked NavMesh on which my characters were able to walk.

So when my game start, it load this scene (with only the NavMesh) and then it loads “additively” the desired piece of the worlds with LoadLevelAdditiveAsync (these levels contain the actual world terrain).

It was very slow and hard for editor, but it worked.

What you do is add an empty game object with a off mesh link to a prefab then when you bake you mesh make sure you have offmeshlink remenber the off link component needs two points so one should be connected to the main nav mesh set the office link mesh start and end up if you want you can even make it bi directional now your nav mesh should with work with the prefab unity has a whole video on it Offmesh Links - Unity Official Tutorials - YouTube ive olny done limited test but it should work since the offmesh link doenst need to bake

This is STILL an issue in Unity 5. Good lord. I won’t hold my breath for a solution in Unity 6.