Search Issue Tracker
Fixed
Fixed in 2022.3.5f1, 2023.1.2f1, 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
- Size value in Particle System Curve's tab is highlighted with selection across all tab header
- Particle System Curve's Presets window has no visual indication of what preset is selected
- Blur shader doesn't work when the "Scene Color" Node is attached to the UI "Output" Node
- Particle System Curve presets can't be scrolled and some of them can't be selected if window is too narrow to fit them all
- Mistakes in multiple Particle System Components pop-up
Resolution Note (fix version 2023.2.0a20):
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.2f1):
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.