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
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
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