Search Issue Tracker
By Design
Votes
0
Found in
2020.3.40f1
2021.3.9f1
2022.1.16f1
2022.2.0b8
2023.1.0a10
Issue ID
UUM-15821
Regression
No
mesh.SetVertexBufferData and mesh.SetIndices calculates bounds incorrectly when mesh.RecalculateBounds is not called
To reproduce:
1. Open the user’s project
2. Enter Play mode
3. Observe the Console
Expected result: Log “Center: (0.50, 0.50, 0.50), Extents: (0.50, 0.50, 0.50)”
Actual result: Log “Center: (0.00, 0.00, 0.00), Extents: (0.00, 0.00, 0.00)”
Reproducible with: 2020.3.40f1, 2021.3.9f1, 2022.1.16f1, 2022.2.0b8, 2023.1.0a10
Reproduced on: macOS Monterey 12.5.1 (Intel)
Workaround: Uncomment the line 71 “{{mesh.RecalculateBounds();”}} (RecalcutateBounds.cs)
Note: Reproducible in the Editor and in the Player
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
- Size value in Particle System Curve's tab is highlighted with selection across all tab header
- Particle System Curve's Presets window has no visual indication of what preset is selected
- Blur shader doesn't work when the "Scene Color" Node is attached to the UI "Output" Node
- Particle System Curve presets can't be scrolled and some of them can't be selected if window is too narrow to fit them all
- Mistakes in multiple Particle System Components pop-up
Resolution Note:
The bound recalculation is done for the submesh, not the mesh. Mesh.SetIndices takes the submesh in as a parameter. The result of the recalculation can be found on the bounds of that submesh; mesh.GetSubMesh(0).bounds in this case. When printing this to the console the expected value is observed.
We have a backlog item to smooth out the behavior around mesh bounds and submesh bounds. However, we have other higher priority work at the moment.
See also:
- https://issuetracker.unity3d.com/issues/bounds-are-not-applied-to-mesh-when-using-mesh-dot-applyanddisposewritablemeshdata
- https://docs.unity3d.com/ScriptReference/Rendering.MeshUpdateFlags.DontRecalculateBounds.html