Search Issue Tracker
By Design
Votes
0
Found in
2017.3.1p3
Issue ID
1022365
Regression
No
Mesh.bounds.center returns word space position instead of local space
Steps to reproduce:
1. Open the attached project
2. Open the SampleScene.unity scene
3. The scene contains empty gameobject(Parent) and cube as a child gameobject
4. Cube's word space position is (0,0,5)
5. Play the scene
6. Observe the Console Window, it prints (0,0,5) instead of local space position as a documentation states
Reproduced with: 2017.1.3p2, 2017.2.2p3, 2017.4.1f1, 2018.1.0b13, 2018.2.0a7
Note:
https://docs.unity3d.com/ScriptReference/Mesh-bounds.html
Actual results Mesh.bounds.center returns word space position
Expected: Mesh.bounds.center should return local space position
Comments (1)
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
- [iOS] "UnityBatchPlayerLoop()" causes a freeze in the iOS application when it is put to the background and brought back to the foreground
- "Perform Selected" of Shortcut Manager window does not perform the shortcut in some cases
- Crash on mono_get_hazardous_pointer when running Play Mode tests in a specific project
- [iOS] ‘확인’(Done) and '취소'(Cancel) text is displayed as '...' in the on-screen keyboard when the System preferred language is set to Korean
- No warnings when creating the selector with the duplicate name
marctem
Apr 30, 2018 15:59
Mesh.bounds.center _does_ return local space position. The code in your example project is using GetComponent<MeshRenderer>(), and as noted in the docs you linked, MeshRenderer.bounds.center returns world space position.
If you want local space, you should use GetComponent<MeshFilter>().mesh.bounds.center.