Search Issue Tracker

By Design

Votes

1

Found in

2022.3.60f1

6000.0.50f1

6000.1.4f1

6000.2.0b1

Issue ID

UUM-107619

Regression

No

Errors are thrown when closing or changing the scene

-

Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Scenes/Level2.unity“ Scene
3. Enter the Play Mode
4. Open the “Assets/Scenes/MainMenu.unity“ Scene while in Play Mode
5. Observe the Console window

Expected result: No errors are thrown
Actual result: Errors are thrown

Reproducible with: 2022.3.60f1, 6000.0.50f1, 6000.1.4f1, 6000.2.0b1

Reproducible on: Windows 11
Not reproducible on: No other environment tested

Errors:

  • Cannot set the parent of the GameObject '<name>' while activating or deactivating the parent GameObject '<parentName>'.
  • Coroutine couldn't be started because the the game object '<name>' is inactive.
  1. Resolution Note:

    This behaviour is expected as were guarding against these scenarios where scene hierarchy changes are being made when there is a scene change happening. Hence the error message asking to avoid these scenarios.

    In order to solve it try checking object to be dechilded is active (It would be better to check for parent object but this is close enough as the whole scene is being unloaded anyway)

Comments (2)

  1. Oronyx9_9

    May 30, 2025 03:40

    Small correction in my previous reply: In step 4, the spacebar may have to be pressed 2-4 times rather than just once for it to be reproduced. Regardless, it still occurs while interacting with the GameObject with a component that starts/stops a coroutine.

  2. Oronyx9_9

    May 30, 2025 03:35

    Just a note: The second error (Coroutine couldn't be started because the the game object '<name>' is inactive.) won't actually be reproduced by the above steps but instead by the following:

    1. Open the attached “BugRepro” project
    2. Open the “Assets/Scenes/Level3.unity“ Scene
    3. Enter the Play Mode
    4. Press Spacebar
    5. Immediately open the “Assets/Scenes/MainMenu.unity“ Scene while in Play Mode
    6. Observe the Console window

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.