Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

NavMeshSurface.Bake asynchronously?

Discussion in 'AI & Navigation Previews' started by Quidam2k, Mar 8, 2017.

  1. Quidam2k

    Quidam2k

    Joined:
    Apr 6, 2015
    Posts:
    6
    I'm working on a project where the surface for which I want to create a NavMesh is created dynamically at run time, and it doesn't use prefabs, making using NavMeshSourceTag problematic. If I put a NavMeshSurface on the gameobject that dynamically builds the mesh and have it collect all, that works like a charm. However, only part of the area is visible at any given point in time, so I need to be able to update the NavMesh dynamically too. Doing so hangs execution unless I can find a way to do it asynchronously with a NavMeshSurface.

    Thanks in advance, and let me know if there's anything I can add that might help.
     
  2. Quidam2k

    Quidam2k

    Joined:
    Apr 6, 2015
    Posts:
    6
    I ended up moving some of the code from NavMeshSurface into a new version of LocalNavMeshBuilder, and thus achieve my aim, but I think it'd be useful for NavMeshSurface to be able to bake asynchronously.
     
  3. STONEHEAD_GAMES

    STONEHEAD_GAMES

    Joined:
    Jan 10, 2014
    Posts:
    1
    I'm running into a similar problem, would you mind posting the code to your custom LocalNavMeshBuilder?