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
7000.0.0a1
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
- Some UXML Template Asset foldouts appear enabled when all fields inside are disabled
- URP Terrain Demo crash on burst_signal_handler after Generating lighting
- Project window button icons are poorly visible and their shades differ in Light theme
- GC.Alloc called by HDRenderPipeline.LensFlareMergeOcclusionDataDrivenPass() when playing the default HDRP Sample Template project
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
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.