Search Issue Tracker
By Design
Votes
0
Found in
6000.0.32f1
Issue ID
UUM-95952
Regression
No
GameObjects created by ISystem.OnCreate does not get destroyed when unloading the Scene with SceneManager.LoadScene
Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/SampleScene1.unity” Scene
3. Enter the Play Mode
4. Observe the Hierarchy and Console, after the Scene switches to SampleScene2
Expected result: GameObject “TestBehaviour“ does not exist and messages “OnDisable called” and “OnDestroy called” are present in the Console
Actual result: “TestBehaviour“ does not exist and only “OnEnable called” is present in the Console
Reproducible with: 1.2.0 (6000.0.32f1), 1.3.8 (6000.0.32f1)
Reproducible on:
Play Mode
Windows Standalone Player
Testing environment: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested
Notes:
- Reproducible when the Scene loading gets delayed
- Not reproducible when loading the other scene additive and then unloading the current Scene
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 Builder background color picker alpha values are set to even numbers when saving alpha value as an odd number
- Objects are hard to read in the Hierarchy when using a high resolution display with a low display scale
- Animation triggers do not reset after playing animation
- "Invalid vertex attribute format" error message does not mention "bytes" when the data size is mismatched
- [Windows] About Unity window displays Editor version in two lines instead of one when monitor scale set to 250%
Resolution Note:
Thank you for reaching out to Unity.
Specifically, when "HideFlags.DontSaveInEditor" is set, "OnDisable" and "OnDestroy" are not called on components of objects with that flag set when exiting editor play mode.
This behaviour is as designed. We will close this bug report 'as designed' as we did previously.