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
- Animator Controller throws MissingReferenceException after undoing Layer Creation
- Full stack trace is always printed when an exception occurs in an IL2CPP build
- Licensing Client fails to launch when opening Unity Hub (licensing client path is not found)
- Licensing Client fails to launch when opening Unity Hub
- Different custom Shader behavior when GPU Resident Drawer is enabled
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.