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
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
- "TLS Allocator ALLOC_TEMP_TLS" errors are thrown when unsuccessfully importing an FBX file
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