Support Forum

Navmesh cut doesn't update when added at the beginning of play

I am encountering an issue where the game is loading walls that have Navmesh Cut components on them, and normally they work great and update accordingly, but it seems that if the walls are loaded in within the first seconds of the game then when I move the wall, the cut still exists.

I disabled scan on awake and debug isn’t showing any calls to active.Scan(), but about 6 seconds into the game, it seems to have scanned the graph or something similar to update the graph with the wall navmeshcuts permanent.

Is there anything you can think of that would trigger a navmesh cut to be calculated into the graph without a call to active.Scan() ?

If it helps, I am using:
Recast Graph
Cache startup = true
scan on awake = false

Perhaps at the time of baking the navmesh, you accidentally set the wall’s physics layer to be part of the scan. You need to have it ignore the wall in the layers and let nav mesh cuts do the work

2 Likes

Thanks for the input. Initially I thought I had done just that but reviewing it again I saw a child object on a layer that was not ignored by the scan. After fixing that the scan no longer sees that object so that should work.

The question I still have is in what case would the scan be done again after startup when the scan is cached and loaded? I would think that is the point of caching it so the scan doesn’t have to be repeated.

I have a pretty significantly large pathfinding area and scanning again is a big waste if it is happening.
Are there any cases that the system will rescan for some reason?

I think I understand what is going on now, I load in the floors and the tiles, (a lot of loading for a large scene, I imagine, would take a few seconds) and the floor tiles that have DynamicGridObstacle elements load in and update the mesh around the walls.

thanks for your help @Michael_Duan

1 Like