Search Issue Tracker
By Design
Votes
0
Found in
2020.2.0a10
2020.3.3f1
2021.1
2021.2
Issue ID
1328780
Regression
Yes
Prefab doesn't get enabled in the Hierarchy after changing Scene and the Prefab is a child GameObject in the Scene
How to reproduce:
1. Open the user's attached "SetActiveTest.zip" project
2. Open the "SetActiveTest" Scene
3. Enter Play Mode
4. Press the left mouse button in the Game view
5. Exit Play Mode
6. Open the "SampleScene" Scene
7. Repeat steps 2-4
Expected result: "TestText" GameObject gets enabled in the Hierarchy window
Actual result: "TestText" GameObject doesn't get enabled in the Hierarchy window
Reproducible with: 2020.2.0a10, 2020.3.8f1, 2021.1.8f1, 2021.2.0a17
Not reproducible with: 2018.4.35f1, 2019.4.27f1, 2020.2.0a9
Note:
- To see a clear repro for a second time you need to delete the Library folder (Restarting the Editor also fixes in some cases)
- The issue is not reproducible when the wanted Prefab is not a child of any GameObject
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
- "NullReferenceException: Object reference not set to an instance of an object" error is thrown when attempting to remove a binding in the UIBuilder for a UxmlObjectReference
- Missing script error when clicking “script” link in Cave scene’s Water Sample Description
- [VFX Graph] Set Position Shape Gizmo isn't refreshed after shaper switch
- NullReferenceException is thrown when trying to access volumeStack from the HDCamera class
- Visual artifacts appear when using an Orthographic camera with a Reflection Probe
Resolution Note:
This is not a regression nor is a bug. When using https://docs.unity3d.com/ScriptReference/Resources.FindObjectsOfTypeAll.html you have to filter the persistent objects out of the result if you only want the Scene objects. It is shown in the example in the documentation how to do this.
The fact that is seemingly worked before is simply by chance. Had the user selected the prefab in the Project Browser before loading any scenes it would also have failed.