Search Unity

Local NavMesh Builder performance stutter that fixes when disabling and enabling object

Discussion in 'Navigation' started by Acissathar, Jan 13, 2019.

  1. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    Hi all,

    As the long title says, I'm trying to run the local navmesh builder straight from the Git repo to bake navmeshes at run time. I was wondering if anyone else ran into this issue as well.

    The baking itself is going as expected, however, while running I suffer ~30 FPS drop. This drop is remedied when I disable the builder object, and re-enable it.

    The baking continues to work as expected, so I'm wondering where this drop is coming from. One solution is to have it disable and re-enable at the start, but that seems especially hacky given I'm not sure why it's happening.

    This is in 2018.3.

    Thanks!
     
  2. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    After some deeper digging, the NavMesh is not working as expected after flipping the active state of the Mesh Builder.

    The source of the drop is the Enumerator in the LocalNavMeshBuilder script, coupled with NavMesh.AcquireSharedMesh, and NavMesh.ExtractTerrainMesh. The enumerator isn't restarted after flipping the active state, which explains why the drop disappears.

    So nothing weird as I originally thought it might be.
     
  3. providedyy

    providedyy

    Joined:
    Jun 10, 2020
    Posts:
    1
    I also meet this problem in my porject.
    NavMesh.ExtractTerrainMesh cost 3.87ms every frame. Is it because terrainMesh is too large or complex?(My terrain area is 4km*4km)
     
  4. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    Performance is a huge issue in runtime navmesh, is there any alternative for this package? they say unity 2022 focus on runtime navmesh need to try it