Network SceneManager not syncing NetworkAnimator Layers

I use the Networkmanager Scenemager (single mode) and Network Animator (client authoritive).

When switching scene I get the error that a layer does not exist. But it’s there when looking at the animator window during runtime (at client and host).

[Netcode] [DestinationState To Transition Info] Layer (0) does not exist!
UnityEngine.Debug:LogError (object)
Unity.Netcode.NetworkLog:LogError (string) (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Runtime/Logging/NetworkLog.cs:34)
Unity.Netcode.Components.NetworkAnimator:UpdateAnimationState (Unity.Netcode.Components.NetworkAnimator/AnimationState) (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Components/NetworkAnimator.cs:1181)
Unity.Netcode.Components.NetworkAnimator:SendAnimStateClientRpc (Unity.Netcode.Components.NetworkAnimator/AnimationMessage,Unity.Netcode.ClientRpcParams) (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Components/NetworkAnimator.cs:1293)
Unity.Netcode.Components.NetworkAnimator:__rpc_handler_1069363937 (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@1.5.1/Runtime/Messaging/Messages/RpcMessages.cs:70)
Unity.Netcode.ClientRpcMessage:Handle (Unity.Netcode.NetworkContext&) (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Runtime/Messaging/Messages/RpcMessages.cs:151)
Unity.Netcode.NetworkMessageManager:ReceiveMessage<Unity.Netcode.ClientRpcMessage> (Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&,Unity.Netcode.NetworkMessageManager) (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Runtime/Messaging/NetworkMessageManager.cs:564)
Unity.Netcode.NetworkMessageManager:HandleMessage (Unity.Netcode.NetworkMessageHeader&,Unity.Netcode.FastBufferReader,ulong,single,int) (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Runtime/Messaging/NetworkMessageManager.cs:432)
Unity.Netcode.NetworkMessageManager:ProcessIncomingMessageQueue () (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Runtime/Messaging/NetworkMessageManager.cs:458)
Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Runtime/Core/NetworkManager.cs:42)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Runtime/Core/NetworkUpdateLoop.cs:185)
Unity.Netcode.NetworkUpdateLoop/NetworkEarlyUpdate/<>c:<CreateLoopSystem>b__0_0 () (at Library/PackageCache/com.unity.netcode.gameobjects@1.5.1/Runtime/Core/NetworkUpdateLoop.cs:208)

Spawning happens at OnLoadEventCompleted. I’m not sure where in the synchronisation or scene changing the error apears. Maybe in the first frame the layer is not there but after the second frame? Or the animator is already syncing while spawning not finished?

Everything works well when host and client connects to one/first scene, only on scene changing the error occurs (also when changing to same scene). It also works when host is alone and changing scene. And ofc when removing networkanimator component.

Edit: i tried with 2021.3.24 & ngo 1.4 and 2021.3.28 & ngo 1.51.

2 Likes

Anyone an idea from what the error could appear?

I have a very similar problem to yours, except the error (the same as yours) happens whenever I do ANY animation clip transition, but it does NOT happen when using blend trees as a default state