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
- Tile Palette selected dropdown text does not update when palette is renamed
- ArgumentException thrown and reference to Template gets unset when opening UXML file after editing referenced Template in Play mode
- [iOS][WebGL] Player freezes when multiple properties of a VisualElement are changed at the same time
- Warning 'GetControlID at event ValidateCommand returns a controlID different from the one in the Layout event' is logged when undoing the deletion of an Edited Freeform 2D Light
- ShadowCaster2D breaks on certain Rotation positions when Casting Source is set to PolygonCollider2D
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.