0
\$\begingroup\$

Hey all I had a question, I was looking into my game's performance and noticed this in the profiler:

Peformance capture

Is there any way to optimize this such as pre-generating tiles so it doesn't have to do it each update :) ?

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Can you provide a Minimal Complete Verifiable Example? What would we need to put into a new, empty project in order to reproduce the navmesh update cost you're observing here? \$\endgroup\$
    – DMGregory
    Mar 12 at 8:32
1
\$\begingroup\$

Your profiler hierarchy includes this entry:

Carving.ApplyResults

Carving is an optional feature where non-static obstacles can cut a hole into the NavMesh. Carving is expensive because it actually modifies the NavMesh, which is why Unity recommends only enabling Carving while an object is not moving.

If you have a moving NavMeshObstacle with Carving enabled and "Carve Only Stationary" unchecked, it's going to be carving and rebuilding part of the Nav Mesh frequently as it moves around (possibly every frame if the Move Threshold is low). That could explain the entries you're seeing in the profiler.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.