Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.32f1
2022.3.13f1
2023.2.0f1
2023.3.0a14
6000.0.0b11
6000.1.0a7
Issue ID
UUM-57057
Regression
No
GameObject created by "new GameObject()" does not disappear when exiting Play mode.
How to reproduce:
1. Open the user-attached project
2. Open the “MinJoon” Scene
3. (Optional) Make sure there is no “@Pool_Root” GameObject in the Hierarchy window
4. Enter Play mode and then Exit Play mode
5. Observe the Hierarchy window
Expected results: “@Pool_Root” GameObject gets destroyed after exiting Play mode
Actual results: “@Pool_Root” GameObject stays in the Hierarchy window
Reproducible with: 2021.3.32f1, 2022.3.13f1, 2023.2.0f1, 2023.3.0a14
Reproduced on: Windows 10 (by reporter), Windows 11
Not reproducible on: No other environment tested
Notes:
- Not reproducible on a new project
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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
The problem in this case is in the customer's project: there is a class named 'HealthBar' that on start calls 'ManagerRoot' full or partial initialization depending on if we're in Play Mode. So when we enter play mode, the chain is triggered because PlayMode is started, but when we exit it, due to 'HealthBar' class having ExecuteInEditMode it is triggered again, because it entered edit mode. The most simple solution to this would be either removing ExecuteInEditMode in 'HealthBar' if not necessary or avoid initializing ManagerRoot if Application.isPlaying is false.
Resolution Note:
The problem in this case is in the customer's project: there is a class named 'HealthBar' that on start calls 'ManagerRoot' full or partial initialization depending on if we're in Play Mode. So when we enter play mode, the chain is triggered because PlayMode is started, but when we exit it, due to 'HealthBar' class having ExecuteInEditMode it is triggered again, because it entered edit mode. The most simple solution to this would be either removing ExecuteInEditMode in 'HealthBar' if not necessary or avoid initializing ManagerRoot if Application.isPlaying is false.