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, 2021 at 8:32

1 Answer 1

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\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .