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
- "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:
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.