Search Issue Tracker
Fixed in 2022.3.5f1
Fixed in 2022.3.X, 2023.1.X, 2023.2.X, 2023.2.0a20
Votes
0
Found in
2020.3.45f1
2021.3.18f1
2022.2.8f1
2023.1.0b5
2023.2.0a4
Issue ID
UUM-28068
Regression
No
A second unparented GameObject is created when duplicating a Prefab with a child that has HideFlags.DontSave
Reproduction steps:
1. Open the attached project “BugDuplicatedObjectWithHideFlags”
2. Select “ObjectWithAutoCreatorAsPrefabInstance” in the Hierarchy window
3. Duplicate the selected GameObject
Expected result: there is only one “~SubObjectHidden” child GameObject
Actual result: there are two “~SubObjectHidden” GameObjects and the second one is unparented and not affected by the SubObjectHideInInspector Script on the parent
Reproducible with: 2022.2.8f1, 2023.1.0b5, 2023.2.0a4
Not reproducible with: 2020.3.45f1, 2021.3.18f1
Reproducible on: macOS 12.4 (Intel), Windows 11 (user’s)
Note: in 2020.3.45f1 and 2021.3.18f1, the child is not unparented
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
- [Tile Palette] Sprites not rendering when brush tool "Paint a filled box with active brush" is used for the first time
- Adding available Nodes with longer names in Fragment Context window overflow Fragment Context window in Shader Graph
- "Layer Palette Profile" Asset is automatically applied to the second Terrain but doesn't load any layers
- "Terrain Tools" shortcut conflicts with the Overlays shortcut by default
- Longer Shader Graph Property Reference names breaks VFX Graph Output Particle Node
Resolution Note (fix version 2023.2):
Please make sure to call PrefabUtility.RecordPrefabInstancePropertyModifications(this) in SubObjectHideInHierarchy.cs after adding the child object and setting the hideflag. This ensures that the changes to the instance are registered, and results in correct behaviour when duplicating.
Resolution Note (fix version 2023.1):
Please make sure to call PrefabUtility.RecordPrefabInstancePropertyModifications(this) in SubObjectHideInHierarchy.cs after adding the child object and setting the hideflag. This ensures that the changes to the instance are registered, and results in correct behaviour when duplicating.