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
- Missing script error when clicking “script” link in Cave scene’s Water Sample Description
- [VFX Graph] Set Position Shape Gizmo isn't refreshed after shaper switch
- NullReferenceException is thrown when trying to access volumeStack from the HDCamera class
- Visual artifacts appear when using an Orthographic camera with a Reflection Probe
- Not all animation properties are accessible when a prefab with an avatar model contains a nested copy of itself with a renamed GameObject
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.