Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.40f1
2022.3.38f1
6000.0.11f1
7000.0.0a1
Issue ID
UUM-75780
Regression
No
Script Execution Order setting is not respected when reloading a Scene
Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Scenes/MainScene” Scene
3. Enter Play Mode
4. In the Hierarchy window, select the “SceneController” GameObject
5. In the Inspector window, open the context menu of “Scene Controller” script
6. In the context menu, select “RestartScene”
7. Observe the logged execution order in the Console
Expected result: OnDestroy() is executed in the “Scene Controller” script first and then in the “Test Behaviour” script
Actual result: A custom warning message is logged, that OnDestroy() was called in “Test Bahaviour” script before “Scene Controller” script
Reproducible with: 2021.3.40f1, 2022.3.38f1, 6000.0.11f1
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Note: The issue does not always reproduce, so steps 4-7 might need to be repeated multiple times
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
- Opening Terrain Prefab in Prefab Editing Mode throws "NullReferenceException" error
- [Search] Dragging query pills put them behind the search text field
- A CustomPropertyDrawer that returns a PropertyField for a property named the same as a child field will not render all child fields
- Graphics Settings shows default values instead of the real values in the Rendering Debugger when Volume.profile is assigned via script
- Deleting multiple Tags throws “NullReferenceException”, and "Retrieving array element that was out of bounds" errors when holding the Enter key
Resolution Note:
OnDisable and OnDestroy never respected execution order settings. Changing this behavior is risky as it will affect users which are relying on executing OnDisable and OnDestroy based on the order in which MonoBehaviors are added to a GameObject
I updated the documentation to reflect this behavior