NetworkAnimator (If there are more than 58 variables in the animator, an error)

If there are more than 58 variables in the animator, an error appears when connecting the second player. Are there any restrictions on the number of variables when syncing via the component network animator? Also, if the variables are less than 58, then there are no errors.

Error: [Netcode] Player(Clone) threw an exception during synchronization serialization, this NetworkBehaviour is being skipped and will not be synchronized!

([Netcode] Player(Clone) threw an exception during synchronization serialization, this NetworkBehaviour is being skipped and will not be synchronized!

More info:

[Netcode] Player(Clone) threw an exception during synchronization serialization, this NetworkBehaviour is being skipped and will not be synchronized!


[Netcode] Player(Clone) threw an exception during synchronization serialization, this NetworkBehaviour is being skipped and will not be synchronized!
UnityEngine.Debug:LogWarning (object)
Unity.Netcode.NetworkLog:LogWarning (string) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Logging/NetworkLog.cs:28)
Unity.Netcode.NetworkBehaviour:Synchronize<Unity.Netcode.BufferSerializerWriter> (Unity.Netcode.BufferSerializer`1<Unity.Netcode.BufferSerializerWriter>&,ulong) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Core/NetworkBehaviour.cs:1383)
Unity.Netcode.NetworkObject:SynchronizeNetworkBehaviours<Unity.Netcode.BufferSerializerWriter> (Unity.Netcode.BufferSerializer`1<Unity.Netcode.BufferSerializerWriter>&,ulong) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Core/NetworkObject.cs:2809)
Unity.Netcode.NetworkObject/SceneObject:Serialize (Unity.Netcode.FastBufferWriter) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Core/NetworkObject.cs:2714)
Unity.Netcode.CreateObjectMessage:Serialize (Unity.Netcode.FastBufferWriter,int) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Messaging/Messages/CreateObjectMessage.cs:112)
Unity.Netcode.NetworkMessageManager:SendMessage<Unity.Netcode.CreateObjectMessage, Unity.Netcode.NetworkMessageManager/PointerListWrapper`1<ulong>> (Unity.Netcode.CreateObjectMessage&,Unity.Netcode.NetworkDelivery,Unity.Netcode.NetworkMessageManager/PointerListWrapper`1<ulong>&) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Messaging/NetworkMessageManager.cs:644)
Unity.Netcode.NetworkMessageManager:SendMessage<Unity.Netcode.CreateObjectMessage> (Unity.Netcode.CreateObjectMessage&,Unity.Netcode.NetworkDelivery,ulong) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Messaging/NetworkMessageManager.cs:821)
Unity.Netcode.NetworkConnectionManager:SendMessage<Unity.Netcode.CreateObjectMessage> (Unity.Netcode.CreateObjectMessage&,Unity.Netcode.NetworkDelivery,ulong) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Connection/NetworkConnectionManager.cs:1540)
Unity.Netcode.NetworkSpawnManager:SendSpawnCallForObject (ulong,Unity.Netcode.NetworkObject) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Spawning/NetworkSpawnManager.cs:1116)
Unity.Netcode.NetworkObject:SpawnInternal (bool,ulong,bool) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Core/NetworkObject.cs:1610)
CharacterSpawner:SpawnRpc (ulong) (at Assets/NetCode/Hosting And Joint/CharacterSpawner.cs:34)
CharacterSpawner:__rpc_handler_3114497794 (Unity.Netcode.NetworkBehaviour,Unity.Netcode.FastBufferReader,Unity.Netcode.__RpcParams)
Unity.Netcode.RpcMessageHelpers:Handle (Unity.Netcode.NetworkContext&,Unity.Netcode.RpcMetadata&,Unity.Netcode.FastBufferReader&,Unity.Netcode.__RpcParams&) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Messaging/Messages/RpcMessages.cs:75)
Unity.Netcode.RpcMessage:Handle (Unity.Netcode.NetworkContext&) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Messaging/Messages/RpcMessages.cs:209)
Unity.Netcode.NetworkMessageManager:ReceiveMessage<Unity.Netcode.RpcMessage> (Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&,Unity.Netcode.NetworkMessageManager) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Messaging/NetworkMessageManager.cs:585)
Unity.Netcode.NetworkMessageManager:HandleMessage (Unity.Netcode.NetworkMessageHeader&,Unity.Netcode.FastBufferReader,ulong,single,int) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Messaging/NetworkMessageManager.cs:444)
Unity.Netcode.NetworkMessageManager:ProcessIncomingMessageQueue () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Messaging/NetworkMessageManager.cs:470)
Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Core/NetworkManager.cs:288)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Core/NetworkUpdateLoop.cs:191)
Unity.Netcode.NetworkUpdateLoop/NetworkEarlyUpdate/<>c:<CreateLoopSystem>b__0_0 () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd5b7db87b58/Runtime/Core/NetworkUpdateLoop.cs:214)

Are you overriding OnSynchronize as it’s possible the error originates there, it’s hard to tell though.

Once you add 59 variables to the animator, this error occurs, even if this variable is not used. As soon as the number of variables is less than or equal to 58, there is no error.

If you need more information, I can provide

I believe you, but are you overriding OnSynchronize, as the source code suggests that’s where the problem could be.

If you rule out it’s a problem in your code create an issue here and the devs can look into it.

I checked NetworkAnimator and it does its own overriding of OnSynchronize so it’s quite possible the exception is thrown there.

Thank you for the answer, I just checked this error on a newly created project and except for one script for hosting and connection, I did not add anything and the error repeats. I will now report this in the github