Search Issue Tracker
Won't Fix
Won't Fix in 2020.1.X
Votes
0
Found in
2019.4.39f1
2020.1.0a19
Issue ID
UUM-11862
Regression
No
GameObject not disbled when changing the sibling order inside OnDisable
1. What happened
If we change the sibiling order of an object inside OnDisable, it can cause that some objects aren't disabled during DestroyObject.
This leads to a lot of undefined behaviours.
This is due to how we iterate the objects in https://github.cds.internal.unity3d.com/unity/unity/blob/93a364f095f55c0e7616dc8d1638d6c6c37b5ad5/Runtime/BaseClasses/GameObject.cpp#L212
2. How we can reproduce it using the example you attached
- Open SampleScene
- Enter play mode
Expected behaviour:
- Both objects log from OnDisable
Actual Behaviour:
- Only Child1 logs from OnDisable
- The editor might crash due to trying to destroy an enabled GameObject
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
- UI Toolkit World UI Text Field unfocuses immediately when clicking on it using XR Controller
- Crash on CallWindowProcW when entering Play mode for the second time and running the Editor in the background while using System.Windows.Forms functions
- 2D Freeform Light shadows disappear when light center is offset from shape bounds
- Crash on MarkAllDependencies when opening scenes with Assets from the YarnSpinner package
- Crash on CollectAllSceneManagerAndObjectIDs when opening a specific Scene
Resolution Note:
The bug is not reproducible in Version: 2020.3.40f1 which is now the legacy LTS.
Resolution Note (2020.1.X):
The bug is not reproducible in Version: 2020.3.40f1 which is now the legacy LTS.