Baked Navmesh Deletes When I Save Project

I’ve gotten into Navmeshes and am following a Udemy course. I’ve set up a simple scene and baked a NavMesh, but whenever I save, the NavMesh deletes. Is this supposed to happen? I don’t really want to have to bake every time I open Unity. I’ve made sure it is not the Navigation window closing aswell so that is not the issue. Thanks for any help.

It’s not supposed to happen.
What makes you think it is deleted? Is there some indication that it is gone? Error message? Visually disappearing?

The actual mesh disappears, as well as the agent’s ability to pathfind. No error message. I also have an editor script which uses the navmesh and previews a route in the editor. I have found a workaround where by changing something other than the navmesh before saving, it keeps the navmesh.

Not a fix, but I noticed that reducing the “Max Slope” in the Bake tab and bake the NavMesh again prevents this behavior to happen.

3 Likes

Thank you for this! I was having this happen too… Weird issue…

1 Like

Happened to me too on 2022.2.6f1.

[mention|C/VbXVE/oy68DrjGFe5FLA==] 's "fix " worked. So weird.

I’m having the same issue and unluckily the max slope method doesn’t work. In fact, it would bake the navmesh but then delete itself when I clicked “Play” It did it randomly when I was testing my different enemies on it and it had worked fine for hours until it just happened. I have absolutely 0 ideas on how it even happened since I did not touch anything to do with the navmesh. I’m really hoping a fix can be found for this cause I’m actually biting my keyboard in rage right now.

An Update on my issue:

Mine was due to me using a navmesh volume inside of a prefab. It would be 3D platforms rotating (the reason why I made it like that is that my game utilises Mario galaxy-like gravity) but it seemed like it would reset to whatever the prefab original navmesh was in the prefab which is something I didn’t bake. It was after I had baked it in the prefab that it worked. Of course due to their being different objects on the platforms I thought building the nav meshes separately in the scene would have been better but it didn’t work.

I’d be surprised if anyone has the same specific issue as I did but how I solved it was just deleting the navmeshsurface component from the prefab and just adding it to it in the scene, that way it’s recognised as its own navmesh.

What a day…