Search Unity

Question Runtime generation inconsistent...

Discussion in 'Navigation' started by christougher, Apr 29, 2022.

  1. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    I'm currently using NavmeshSourceTags and LocalNavmeshBuilder to build a navmesh at runtime on procedurally generated maze and about 50% of the time it works great and the other 50% it's totally patchy and unuseable. I can literally hit play over and over and it will either work or not without changing any settings. I can't seem to figure out what could be causing the problem. Any ideas? NavmeshBad.png NavmeshGood.png
     
    Last edited: Apr 29, 2022
  2. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    268
    Make sure you are baking with the correct settings at runtime. This looks like you are baking for a different agent type in the first image versus the second image. In my experience the build at runtime is consistent given the same settings. Maybe you can log settings just before the bake and see if something is unexpectedly changing?
     
  3. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    I appreciate the input, however there is only one type of agent in the project and it's using straight up vanilla LocalNavMeshBuilder and NavMeshSourceTags. I've narrowed this down to something about the meshes involved to make the invididual maze pieces doesn't play well with the navmeshsurface... This behavior doesn't happen with a quad or other basic unity shape or mesh that I've tried yet. However I've also found that at different coordinates it works consistently Literally if I raise the y value to 0.1 it works fine, unless I move the x,z to a particular wrong spot. If I slowly raise it at runtime it cycles through complete and patchy. I've found that about 20 y it seems stable that I can see. It's the weirdest thing I've seen from Unity and I've only seen this happen with the Meshes from the Qmaze asset...I've messed with this a LOT over the past week.

    Literally anything else I've tried else seems to work totally fine without issue so far.. For now I'll just keep my level at 20+ on the y axis and it seems to work fine. This has been maddening.