Search Issue Tracker
By Design
Votes
6
Found in
2021.3.33f1
2022.3.15f1
2023.2.4f1
2023.3.0a19
6000.0.0b11
Issue ID
UUM-58993
Regression
No
Prefab overrides of children GameObjects with identical names are not saved when overwriting Prefab with PrefabUtility.SaveAsPrefabAsset
Reproduction steps:
1. Open the “ReproProject“ project
2. Open the “Assets/Scenes/SampleScene“ scene
3. Drag and drop the “Assets/TestPrefab“ Prefab into the Hierarchy window
4. Change the Tag to “EditorOnly“ of all the children GameObjects of the “TestPrefab“ GameObject in the Inspector window
5. Select the “TestPrefab“ GameObject in the Hierarchy window
6. Open the “Overrides” Dropdown in the Inspector window
7. Observe the children GameObjects Overrides
8. Overwrite the Prefab (Assets > GeneratePrefab)
9. Repeat steps 5, 6, 7
Expected result: All children GameObjects of the “TestPrefab“ GameObject have the “EditorOnly” tag Override
Actual result: Children GameObjects with identical names of the “TestPrefab“ GameObject are missing from the Override list
Reproducible with: 2021.3.33f1, 2022.3.15f1, 2023.2.4f1, 2023.3.0a19
Reproducible on: Windows 11 Pro (22H2)
Not reproducible on: No other environment tested
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
- Inspector elements are rendered twice when the script component is added via drag-and-drop while the HideFlags.HideInInspector property is set
- Error "Light baking failed with error code 5 (Convergence data not available while rendering lightmaps)" thrown in Console when generating lighting for specific GameObjects
- Copy and Paste options for an Animation Property value are disabled in the Right click contextual menu
- Asset is not found when searching the Label "NewLabel" in Search Window
- "Compute dispatch: missing texture ID..." and "Compute dispatch: missing UAV ID..." warnings are thrown after changing the platform in High Definition 3D template
Resolution Note:
In this case the user creates an entirely new Prefab with the same structure as the existing Prefab. The objects in the new Prefab have different IDs and the overrides can't be applied.
We try to keep as many overrides as possible by setting the IDs of the new objects in the new Prefab to the same values as in the existing Prefab using name matching, but this fails when there are duplicate names. We deliberately don't consider the order of the objects when doing name matching to be able to match reordered objects. The matching algorithm is not perfect, but considering the order will break when new objects are inserted in the hierarchy