Search Issue Tracker
Won't Fix
Votes
0
Found in
2019.4
2020.3
2020.3.17f1
2021.2
2022.1
2022.2
Issue ID
1378365
Regression
No
FormerlySerializedAs Attribute doesn't save the serialized value when properties are used
How to reproduce:
1. Open the attached "case_1378365" project
2. Open the "Test" Scene
3. Select the "TestObj" GameObject in the Hierarchy
4. Set the "MyStringProperty" to any value that's in the "Serialized Property Example" Component in the Inspector
5. Rename the "MyStringProperty" variable to any name
6. Observe the renamed "MyStringProperty" value in the Inspector
Expected result: The "MyStringProperty" value is serialized and the renamed variable value is the same as what was set at the 4th step
Actual result: The renamed "MyStringProperty" value is an empty string
Reproducible with: 2019.4.35f1, 2020.3.27f1, 2021.2.9f1, 2022.1.0b4, 2022.2.0a2
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
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
Resolution Note:
Currently we do not support officially properties serialization. If you want FormerlySerializedAs to work on a backing field of a property you need to put in the name of the backing field: [field: SerializeField, FormerlySerializedAs("<MyStringProperty>k__BackingField")] , you can observe those names in the yaml file when saving your content in Unity Editor. Hope this helps.