2

I had a Scene with a map (some buildings and roads) and Baked Navmesh, then I started Duplicating the Same Scene with modifying some objects inside (not the map or the world), so all the Scenes were sharing the same Navmesh somehow, then I deleted the Navmesh accidentally, Now the only way I seem to find is to create a new baked Navmesh for every Scene which will increase the build size too much!, How can I re-share the same baked Navmesh with all Scenes since all have the same map inside ? I am using Latest Unity3D.

MKH
  • 25
  • 3

1 Answers1

2

Before You Start: if you have a lot of assets in your project changing serialization to Force Text may take a lot of time. So you may want to copy the target scenes to a new project, do the below mentioned steps and paste them back. :)

There is no way to do this from Unity editor, but there is a workaround:

  1. Go to Edit > Project Settings > Editor and change the Asset Serialization to Force Text (default is Mixed) - this makes sure all assets, including your unity scene files are saved as text documents
  2. Now open your scene file (the one with baked NavMesh) in any text editor
  3. CMD+F or CTRL+F to focus on search bar and type "NavMeshSettings". In NavMeshSettings the last entree should be m_NavMeshData:{fileID:1234 //and some more stuff here} - this is reference to your baked NavMesh asset file. Copy the whole line
  4. Now open the second scene that you want to share your NavMesh to (open in text editor again). Find exactly the same line starting with m_NavMeshData, delete it and past the line from the previous scene.
  5. BOOM!

Edit/Tip: You may want to change serialization to Mixed again if you want to. The only downside of texted serialization is bigger files. It is mostly used for version controlling and merging and the scenes and stuff...

Nika Kasradze
  • 2,834
  • 3
  • 25
  • 48
  • I will try this tomorrow and tell you the results, this is what we can call a genius answer!! – MKH Apr 19 '16 at 10:33
  • I tried it now, took only 5 minutes with the Attention you mentioned, thanks again for this wonderful hack! – MKH Apr 19 '16 at 10:46