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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
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.