Search Issue Tracker
Won't Fix
Votes
15
Found in
2021.3.34f1
2022.3.19f1
2023.2.9f1
Issue ID
UUM-62827
Regression
No
Complete NavMesh recalculation when moving an unrelated GameObject
Reproduction steps:
1. Open the attached "NavRefreshProblem.zip" project
2. Open the "SampleScene" Scene
3. Enter the Play mode
4. Click the "SwitchMovement" button in The Game view or manually move the "Unrelated" GameObject around the scene
5. Observe the Console Logs thrown when the NavMesh is modified
Expected results: Moving an unrelated GameObject does not affect the NavMesh in any way, and no polygon changes are logged
Actual results: Unrelated GameObject movement triggers a complete NavMesh recalculation and polygons have new IDs
Reproducible with: 2021.3.34f1, 2022.3.19f1, 2023.2.9f1, 2023.3.0a4
Not reproducible with: 2023.3.0b6
Fixed in: 2023.3.0a5
Reproducible on: Windows 11
Not reproducible on: no other environment tested
Notes:
- Setting the Time Scale to a high value (like 50) greatly increases the occurrence of the issue.
- Disabling (or enabling) the GameObject causes the issue too, but once disabled (or deleted), the issue no longer happens when moving the GameObject.
- Disabling all layer physics interactions or setting colliders to trigger does not affect the outcome.
- Only a NavMesh update triggers this behavior, when trying to debug this UpdateNavMesh is called all the time (as soon as one async call ends, we call it again).
- The resulting NavMesh once rebuilt is identical to the previous one in shape, but all the Nav polygons are new and have a different ID.
-
Whipexx_DigitalSun
Apr 05, 2024 11:40
We tried updating to Unity 6000.0.0b13 and the issue no longer happens with unrelated colliders moving around the scene BUT it does happen with nav related colliders to some degree. When you move a collider around on the scene (like in the example provided) it still sometimes causes polygons that shouldn't be affected to be. This seems to be related to being on the same tile that contains some modifications, so it's much less severe.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Trail Renderer visual doesn't match the positions of vertices when they have been offset
- [Mobile] The Material is not visible when using the Decal Renderer Feature
- Uncaught TypeError: Cannot read properties of undefined is thrown when the tab is inactive for several minutes
- Crash on mono_array_length when building a project
- "StackOverflowException" error when changing spline curve type from "Bezier" to "Auto" in the "Element Inspector"
Resolution Note:
Our hypothesis is that moving the “unrelated” object in the scene is actually causing physics manager to return rigid bodies in a different order when we build navmesh. So even though this body is excluded from the bounds test that physics uses to give geometry to navigation, something about how/when physics applies the culling mask to the query causes a variation in the data that comes back, based on the position of the “unrelated” body.
On the plus side, this issue no longer appears in 2023.3! (Tested on b4.) My assumption is this is related to the pretty substantial refactor work the physics team did for swappable backends. Unfortunately, that also means it is extremely unlikely it will be possible to backport. If this issue becomes more critical (from a support escalation or similar) then I suggest the ticket be forwarded to physics.