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
- [iOS] Back Triple Camera is not focusing manually and automatically
- Mouse inputs cannot be inputted when searching the Shortcuts Menu by type "Shortcut"
- "Debug Assertion Failed!" error when launching Windows Dedicated Server Player with Script Debugging enabled
- [Cinematic Studio][3D HDRP] Shader warnings thrown in the Console window when creating a new project with Cinematic Studio template
- Autoplay is triggered on Audio Assets when changing Asset Bundle tags
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.