Search Issue Tracker
Fixed in 2022.3.37f1
Fixed in 2022.3.X, 6000.0.X, 7000.0.0a11
Votes
0
Found in
2022.3.13f1
2023.1.20f1
2023.2.0b18
2023.3.0a14
6000.0.0b11
6000.1.0a7
Issue ID
UUM-56488
Regression
Yes
Changes made in Awake function with ExecuteAlways attribute are overwritten when duplicating Prefab with a parent
How to reproduce:
1. Open the attached “initialization_issue.zip” project
2. Open the SampleScene
3. Select the “testobject” under the “parent” GameObject in the Hierarchy
4. In the Inspector, set the “mat” field of the “Test Script” component to the “red” material
5. Duplicate (CTRL-D) or copy-paste (CTRL-C, CTRL-V) the “testobject”
6. Observe that the material of the duplicated GameObject does not change
Expected result: The material is applied to the GameObject when the Prefab is duplicated.
Actual result: The material is not applied when the Prefab has a parent
Reproducible in: 2022.1.0a12, 2022.3.13f1, 2023.1.20f1, 2023.2.0b18, 2023.3.0a14
Not reproducible in: 2021.3.31f1, 2022.1.0a11
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- When the Prefab has a parent, five functions are called when it is duplicated in the Hierarchy. However, when the Prefab has no parent, only three functions are called (see attached images).
- Workaround (After performing the reproduction steps):
- 1. Drag and drop the original “testobject” out of the “parent” GameObject in the Hierarchy (make sure “testobject” does not have a parent)
- 2. Repeat reproduction step 5
- 3. Observe how the duplicated GameObject now applies the correct material
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Multiple exceptions are thrown after exiting Play mode when Layout Group component is displayed in Debug Inspector and Padding section is expanded
- ScrollView elements are not restored to their original positions after removing a Layout Group with Undo action
- "Assembly with name already exists" errors are thrown when two packages with different technical names resolve to the same namespace
- A Select Scene Entry is added to Undo History when Deleting while a Scene is selected in the Hierarchy
- The Add Component Menu's back arrow accumulates phantom levels when the Menu is repeatedly opened into a Category and closed without selecting
Add comment