Editor components randomly cause OdinSerializer exceptions in Unity 2022
tracked
Fax
Components sometimes "break" in Unity 2022. They are collapsed, and expanding them reveals nothing. It affects different types of components, i.e. UdonBehaviours or MeshRenderers.
It can be fixed by selecting a different game GameObject.
In my world projects, it's caused by the following error:
ArgumentNullException: Value cannot be null.
Parameter name: unityObject
VRC.Udon.Serialization.OdinSerializer.UnitySerializationUtility.SerializeUnityObject (UnityEngine.Object unityObject, VRC.Udon.Serialization.OdinSerializer.SerializationData& data, System.Boolean serializeUnityFields, VRC.Udon.Serialization.OdinSerializer.SerializationContext context) (at ./Packages/com.vrchat.worlds/Runtime/Udon/Serialization/OdinSerializer/Unity Integration/UnitySerializationUtility.cs:1031)
UdonSharp.UdonSharpBehaviour.UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize () (at ./Packages/com.vrchat.worlds/Integrations/UdonSharp/Runtime/UdonSharpBehaviour.cs:272)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
Log In
ZanyCat
getting a nearly identical error in VRChat SDK - Worlds 3.10.1 when saving a prefab with UdonSharp behaviors.
i get two errors per each udon behavior: one in SerializeUnityObject and one in DeserializeUnityObject.
if a prefab has child variants, then those variants also get updated with errors.
this error occurs whether i save the prefab in prefab edit mode or right click and select "Apply to Prefab".
the error also occurs when a change is made to a script that causes it serialize, e.g. when a public field is added or removed. however, when a change is made that does not affect serialization, then the error doesn't occur.
doesn't matter how many serialized fields are on the Udon behavior, it's always the same two errors.
basically, it seems that any time the prefab has to be serialized by the editor it spits out these errors.
note that this error seems to occur with U# behavior scripts and not with Udon Graph Programs.
doesn't seem to cause any issues with compiling, building or running the udon scripts. it's just a really annoying error that i prefer to not be spamming my logs any time i save my prefabs.
White Lotuz
marked this post as
tracked
This post was marked as
needs more information
Fax
marked this post as
tracked
Please let us know if you encounter this issue, too!