Search Unity

Question Baked Navmesh Deletes When I Save Project

Discussion in 'Navigation' started by ZabioBro, Aug 3, 2021.

  1. ZabioBro

    ZabioBro

    Joined:
    Mar 30, 2020
    Posts:
    3
    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.
     
  2. batvink

    batvink

    Joined:
    Sep 26, 2019
    Posts:
    61
    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?
     
  3. ZabioBro

    ZabioBro

    Joined:
    Mar 30, 2020
    Posts:
    3
    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.
     
  4. rodrigovargas123

    rodrigovargas123

    Joined:
    Jan 7, 2022
    Posts:
    1
    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.
     
    bcjenki3, bn-l and alaskaThunderfk like this.
  5. alaskaThunderfk

    alaskaThunderfk

    Joined:
    Mar 24, 2021
    Posts:
    7
    Thank you for this! I was having this happen too... Weird issue..
     
    bn-l likes this.
  6. bn-l

    bn-l

    Joined:
    Aug 27, 2022
    Posts:
    7
  7. DSilvandoBlade

    DSilvandoBlade

    Joined:
    Dec 22, 2020
    Posts:
    9
    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.
     
  8. DSilvandoBlade

    DSilvandoBlade

    Joined:
    Dec 22, 2020
    Posts:
    9
    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...