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
- Audio Mixer does not change volume when lowering volume on an Audio Mixer loaded from AssetBundles
- Error “Value cannot be null. Parameter name: key UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)” thrown and Addressables build fails when "Include in Build" is disabled and using Addressables For Android package
- “error CS0433: The type 'CodeBinaryOperatorType' exists in both 'System.CodeDom and 'System" compilation errors are thrown when opening a specific project
- Metal Vertex Shader warning is being thrown when creating a VR Template Project
- Asset database warning is thrown when declaring font variable in the USS text file
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