Search Issue Tracker
By Design
Votes
0
Found in
2022.3.61f1
6000.0.46f1
6000.1.0b14
6000.2.0a8
Issue ID
UUM-102553
Regression
No
UI Document gets stuck in the original state when the UI GameObject is disabled and re-enabled
How to reproduce:
1. Open the “UIDocumentStuck.zip“ project
2. Open the “FlightScene“ Scene
3. Enter Play Mode
4. In the Hierarchy, select the “GO1” GameObject
5. Disable and re-enable the selected GameObject in the Inspector
6. Observe the Game view
Expected result: The UI is updated to show a black bar with numbers (correct) and with colored bars
Actual result: UI displays only a black bar with numbers (incorrect), but is not updated to show colored bars
Reproducible in: 2022.3.61f1, 6000.0.46f1, 6000.1.0b14, 6000.2.0a8
Could not test in: 2022.1.X (too many package dependency errors)
Reproduced on: Windows 11 Pro (24H2)
Not reproduced on: No other environment tested
Workaround: Open the “Assets/_Scripts/Ships/ShipUI.cs“ script in any IDE and uncomment lines 53-64
Notes:
- Could not reproduce on a new project
- Might be another bug, after doing all the steps, if the UI Document is disabled, the expected results are yielded
- Disabling and re-enabling the UI Document GameObject also reproduces the issue
- The current UI is in world space, but this can be reproduced in screen space as well
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note:
The intended workaround was found, which is to put the logic in OnEnable. This is described in the documentation here under "Lifecycle of UI Document components" https://docs.unity3d.com/Manual/UIE-create-ui-document-component.html
We will strive to document this behaviour and scenario better in the future.