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
Comments (1)
-
friuns
Jan 04, 2021 13:30
in my project
Reproduced in 2019.4.15f1
not reproduced in 2020.1.13f1
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
- [Android][BiRP] Depth processing is handled incorrectly on certain Android devices when using 2 camera's
- [APV] Cancelling Display Dialog Error is thrown after Adaptive Probe Volumes tab is open in Lighting Window
- [APV] NullReferenceException is thrown when baking Adaptive Probe Volume for a Terrain with Non-GI Contributing Tree Prototypes and multiple APV objects with different LayerMasks are present on the scene
- Hands are not recognized when using Hololens 2
- "OnTriggerExit2D" is called before "OnTriggerEnter2D" when object is destroyed immediately
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