Search Issue Tracker
Fixed in 2021.1.X
Votes
0
Found in
2019.4
2019.4.1f1
2021.1
Issue ID
1289492
Regression
No
[UIElements] EditorGUIUtility.currentWidth returns 0 when using it in a VisualElement
How to reproduce:
1. Open the user's attached "UnityBugUIToolkitInspectorWidth.zip" project
2. Open the "SampleScene" Scene
3. Select "GameObject1" GameObject in the Hierarchy window
4. Observe the Console log
Expected result: Inspector window's width is printed in the Console log
Actual result: "inspector width = 0" is printed in the Console log (indicating that Inspector window's width is not received correctly)
Reproducible with: 2019.4.14f1, 2020.1.13f1, 2020.2.0b11, 2021.1.0a4
Could not test with: 2018.4.29f1 (UIElements are not supported)
Notes:
- EditorGUIUtility.currentWidth returns correct width in the very first time, but later returns 0
- EditorGUIUtility.currentWidth returns correct width when not using it with UIElements
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
- “Readme” Asset is unreadable in the Inspector window when switching Editor Theme to Light
- “NullReferenceException” error thrown when switching Editor Theme to Light if “Unity Version Control” tab is enabled
- A Warning is displayed in the Inspector when a Mesh with any Material is added as a Terrain Detail
- [Android][Vulkan] Memory leak when playing and stopping a video using the Video Player on some devices
- Caret moves by a character when typing "." and any number into 'Grid and Snap' toolbar's input field
Resolution Note (fix version 2021.1):
Fixed in: 2021.1.0a9 wont be backported as the fix is to just make it more obvious this functionality is not supported outside of IMGUI