SerializedReference messes prefab references

Hi, I want to report a pretty annoying bug.
I noticed for a while that a prefab of mine had references that instead of referencing components in my prefab instance were referencing components in the prefab root inside my asset folder.
After some time I discover the cause of this. It was linked to the presence of a reference to a component that had inside a field marked as [SerializableReference]. In other words, I believe that if you have a component marked as such, the script will encounter this issue with all the other references. To solve, you can mark the reference to the object as [System.NonSerialized], or remove the [SerializableReference component].

There are existing posts on this, like this one, that can be found via forum search:

Please update to Unity 2019.3.7f1 - the issue should be fixed there.

1 Like

Thanks a lot for the info runevision.
I’m also seeing a few errors or type: "A script behaviour has a different serialization layout " in scripts that that hold some field with objects that use serializeReferences too. Again, not serializing the fields makes the error go away. Any though on that?

No, I haven’t seen this before. We’d need a bug report to be able to investigate.