Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2020.3
2020.3.18f1
2021.3
2022.1
2022.2
Issue ID
1418497
Regression
No
"This Object contains SerializeReference types which are missing." warning appears when renaming the class or namespace
Reproduction steps:
1. Open the attached "SerializeReference_1209838.zip" project
2. Open the "SampleScene" Scene
3. Go to Hierarchy > Test > Reference and see that the value of the "Value" variable is "2"
4. Change the name of the "TestBehaviour" class or "MyNS" namespace in "SerializeReferenceTest.cs" and "TestBehaviour.cs" scripts
5. Go to Hierarchy > Test > Reference
Expected result: The value of the "Value" variable is "2"
Actual result: The value of the "Value" variable is "0" or "This Object contains SerializeReference types which are missing." warning appears, and the "Reference" field is not displayed
Reproducible with: 2019.4.37f1, 2020.3.33f1, 2021.3.0f1, 2022.1.0b14, 2022.2.0a10
Notes:
- If you open the "Test.prefab" asset after the 4th step, you will see that the reference is laid out as (renamed class or namespace are not updated):
references:
version: 1
00000000:
type: {class: TestBehaviour, ns: MyNS, asm: Assembly-CSharp}
data:
Value: 2
- The warning message appears in 2021.2.0a12 and above
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
- [HDRP] Assertion printed when Maximum Reflection Probe count is higher than 64 due to k_MaxCubeReflectionsOnScreen when Raytracing is enabled
- Seams are visible on the Water System when multiple tiles are used and their Surface type is set to River
- Matching Game View creates unsaved changes even though nothing to save
- AudioClips do not have path or GUID in Build Report and incorrect size is reported
- The rendered color of the preset differs from the preview color when adding a new swatch in the HDR Color Picker
Resolution Note (2022.2.X):
When using [SerializeReference], class rename are not handled automatically. One way around the issue is to use
UnityEngine.Scripting.APIUpdating.MovedFromAttribute
More specifically, using the provided project, you can rename the behavior and successfully load the data using [MovedFrom]
[MovedFrom(false, null, null, "TestBehaviour")]
[Serializable]
public class TestBehaviour1
...