Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

LoadLevelAdditive and NavMeshes with different settings

Discussion in 'Navigation' started by Anozireth, Mar 18, 2015.

  1. Anozireth

    Anozireth

    Joined:
    Feb 7, 2013
    Posts:
    71
    I'm using Unity 5. Currently, if you bake NavMeshes in two scenes with different NavMesh settings, and then load the scenes with LoadLevelAdditive, you get an error that the NavMeshes must be baked with the same settings. We load a few scenes at a time to improve load times when switching between them. This means the scenes all need to have the same NavMesh settings. Our artists are finding this to be an awkward limitation, as settings that work for most scenes may fail to bake in others because it would generate a mesh with too many vertices.

    Are there any plans to remove this limitation in the future? Is there any way to work around this?
     
  2. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    I'm curious why you need to tweak the bake settings to limit vertex count. Also - which settings in particular are you tweaking to achieve this ?

    You may have noticed the tiled layout of the navmesh (light border in a regular grid across the navmesh) - this tiling depends on the bake settings. The tiling has to conform for the navmesh lookup (fast mapping of world position to closest navmesh position) to work.
     
  3. Anozireth

    Anozireth

    Joined:
    Feb 7, 2013
    Posts:
    71
    According to my artist, they had to adjust the Agent Radius to reduce the vertex count. They were doing this because Unity was giving an error when they attempted to bake, something to the effect of "Navmesh contains too many verts, bake failed". Apparently this was before we transitioned to Unity 5, and we aren't currently seeing the error in Unity 5.

    The "too many verts" issue becomes moot if we can be assured that no matter what navmesh bake settings we use, assuming they work for one scene, they will work for all scenes of approximately the same size and vert density. This doesn't appear to have been the case before Unity 5.

    But ideally that wouldn't be the case regardless, and we could bake each scene with whatever settings work best for that scene and not have to worry about the settings matching to be able to load the scenes with LoadLevelAdditive.
     
  4. Gamba

    Gamba

    Joined:
    Feb 8, 2015
    Posts:
    29
    Hi,

    Sorry to necro an old thread, but I have the exact same problem, yet we aren't trying to bake different scenes with different settings, though I don't see why more fine control is not allowed. For instance, we'd like to be able to move geometry, to prevent overlapping navmeshes between scenes that aren't baked together, but the navmesh doesn't move with it.

    Anyway, we've set all our bake settings the same, baked, and then proceeded to load scenes additively. We couldn't figure out why we were getting the error until I diff'd the two navmesh asset files (see attached). It appears that the rounding error is causing the problem and when I manually edited the file, the navmesh loaded properly.

    We actually have quite a few scenes we're loading in and I'm not sure why some have the same values, and some the others. It seems to be the same group of scenes that get the same values when baking. So is this a Unity bug that I should submit or are we doing something wrong in the scene? Thanks.

    BTW, I'm on 5.3.5f1

    settings.PNG
    diff.PNG
     
unityunity