Search Issue Tracker

Fixed

Votes

0

Found in

5.3.4f1

Issue ID

803520

Regression

No

After commenting FormerlySerializedAs attribute variable's value is changing to 0 only after building the project

Scripting

-

Reproduction steps:
1) Open user's attached project
2) Select "Test prefab" prefab in Project window then change "Test variable" value inside inspector to any other (for example 64)
3) Open "TestScript" script and change "testVariable" viarble's name to any other (for example "newName")
4) Uncomment "[UnityEngine.Serialization.FormerlySerializedAs("testVariable")]" attribute
5) Go back to Unity
6) Go to the "TestScript" script and comment "[UnityEngine.Serialization.FormerlySerializedAs("testVariable")]" attribute
7) Go back to Unity and notice that "New name" value in prefab has not changed.
8) Build project for any platform and go back to Unity

Actual result:
"New name" value has changed to 0

Expected result:
"New name" value has to remain same as before building project OR should change to 0 right after commenting "[UnityEngine.Serialization.FormerlySerializedAs("testVariable")]" attribute

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.