Search Issue Tracker
Fixed in 2021.1.X
Fixed in 2019.4.X, 2020.2.X
Votes
2
Found in
2019.4.16f1
2020.1.12f1
2020.2.0b10
2021.1
Issue ID
1296458
Regression
Yes
Variables use old overridden values on Prefabs when a variable has FormerlySerializedAs attribute
How to reproduce:
1. Open the user's attached "SerializationTest" project
2. Open the Scene "SampleScene"
3. Select the "TestObject" GameObject
4. In the Inspector observe the "Test Script" "New Name" variable
Expected results: The "New Name" variable's value is "OVERIDDEN NEW VALUE!"
Actual results: The "New Name" variable's value is "OVERIDDEN OLD VALUE!"
Reproducible with:2019.4.16f1, 2020.1.12f1, 2020.1.16f1, 2020.2.0b10, 2020.2.0b14, 2021.1.0a8
Not reproducible with: 2018.4.30f1, 2019.4.15f1, 2020.1.0a1, 2020.1.11f1, 2020.2.0a1, 2020.2.0b9
Notes:
- Steps to reproduce this issue from scratch:
1. Create a Prefab and attach script with "public string oldTest = "A";" line to the Prefab
2. Add the Prefab to the Scene and in the Inspector change the variable's value to "OLD"
3. In the script add "[FormerlySerializedAs("oldTest")]" before the previous added line and change the variable's "oldTest" name to "newTest"
4. In the Inspector change the variable's value to "NEW"
5. Restart the Editor, the value will be "OLD" in the Prefab's that's in the Scene
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
- Sprite Preview is broken when the Sprite is too tall or too wide
- Objects are invisible in Scene view when using Wireframe Shading Mode
- The property of a component becomes read-only when it is bound to "PropertyStreamHandle"
- Physics.Raycast does not work when used on the whole model
- Shader Graph changes the Position of Prefab instances in Play mode
Resolution Note (fix version 2021.1):
Fixed in 2021.1.0b4
Resolution Note (fix version 2020.2):
Fixed in 2020.2.3f1
Resolution Note (fix version 2019.4):
Fixed in 2019.4.19f1