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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.