Search Issue Tracker

Fix In Review for 2021.1

Fix In Review for 2019.4, 2020.2

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

Scene Management

-

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)

  1. Fc6526b7389ececbcb690c5f9fe037da?d=mm

    friuns

    Jan 04, 2021 13:30

    in my project
    Reproduced in 2019.4.15f1
    not reproduced in 2020.1.13f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.