Search Unity

Cannot clear/delete any navmesh- weird bug

Discussion in 'Navigation' started by imaginationrabbit, Dec 13, 2020.

  1. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    I have a strange bug in 2019.4.13f1

    I'm using the legacy Navmesh system. I'm unable to clear any navmeshes and every navmesh that was baked in any scene shows up in every scene, even in new scenes o_O

    Example- I make a new scene and this is here

    I hit clear Navmesh and nothing happens. There was about 7 navmesh like this in every scene I could only remove them by finding the navmesh assets in the project and deleting them but this one persists.

    I want to switch over to the Navmesh Component system in this project but I need to get rid of this ghost navmesh first. Any ideas? Thanks

    [SOLVED]

    A quit/relaunch got rid of the ghost Navmesh and I switched over to the component system
     
    Last edited: Dec 14, 2020
    dudester, median and mfatihbarut like this.
  2. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
    Still see this all the time in the component-based navmesh. It's very annoying.
     
    unity_AkGames likes this.
  3. unity_QJ7RazXzghZCzA

    unity_QJ7RazXzghZCzA

    Joined:
    Jul 9, 2021
    Posts:
    104
    +1
    Unity 2021.3.13f1. Problem appears with domain-reload disabled. It is not just "Ghost" navmesh. Agents keep using invalid navmesh(both valid and invalid, from another scene) making them move ignoring walls etc.
    FIX ASAP!
     
  4. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
    Yeah it's super frustrating. We just added a stupid helper menu item so you can open an empty scene and run this to clear it without restarting the editor.

    Code (CSharp):
    1.         [MenuItem("Light Brigade/Debug/Force Cleanup NavMesh")]
    2.         public static void ForceCleanupNavMesh()
    3.         {
    4.             if (Application.isPlaying)
    5.                 return;
    6.  
    7.             NavMesh.RemoveAllNavMeshData();
    8.         }
     
  5. lloydsummers

    lloydsummers

    Joined:
    May 17, 2013
    Posts:
    359
    This worked great - I just stopped to say thankyou
     
    kalineh likes this.
  6. Denied87

    Denied87

    Joined:
    Jun 16, 2015
    Posts:
    1
    thank you!
     
    mbussidk likes this.
  7. ngoansc

    ngoansc

    Joined:
    Nov 17, 2021
    Posts:
    2
    Hi I have same problem. When I create new scene, the old navmesh form first navmesh of scene I play will replace in new scene
     
  8. OctoSharko

    OctoSharko

    Joined:
    Dec 9, 2016
    Posts:
    36
    So elegant, it deserves a huge : "THANK YOU"
     
  9. Sometimes_Always_Never

    Sometimes_Always_Never

    Joined:
    Apr 5, 2014
    Posts:
    28
    Grateful for you sharing that menu item! I'm amazed (and not amazed) that Unity has done nothing to fix this bug for several years.
     
  10. Strom_CL

    Strom_CL

    Joined:
    Nov 17, 2012
    Posts:
    115
    Just ran into this issue today on 2021.3.31f1, appreciate the script for getting around this bug! Been fighting my navMesh agents not moving correctly for over an hour after I added some obstacles and rebaked and noticed that even after clearing there was still navMesh data. So frustrating.
     
    Last edited: Nov 20, 2023