Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.40f1
2022.3.38f1
6000.0.11f1
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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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