If I have two clients connected to a server and then one of the clients leave than anytime I try to update any network variable on the client still connected an object reference error occurs.
NullReferenceException: Object reference not set to an instance of an object
Unity.Netcode.NetworkVariableBase.OwnerClientId () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/NetworkVariable/NetworkVariableBase.cs:163)
Unity.Netcode.NetworkVariableDeltaMessage.Serialize (Unity.Netcode.FastBufferWriter writer, System.Int32 targetVersion) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Messaging/Messages/NetworkVariableDeltaMessage.cs:61)
Unity.Netcode.NetworkBehaviour.NetworkVariableUpdate (System.UInt64 targetClientId, System.Int32 behaviourIndex) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Core/NetworkBehaviour.cs:758)
Unity.Netcode.NetworkBehaviour.VariableUpdate (System.UInt64 targetClientId) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Core/NetworkBehaviour.cs:712)
Unity.Netcode.NetworkBehaviourUpdater.NetworkBehaviourUpdate () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Core/NetworkBehaviourUpdater.cs:53)
Unity.Netcode.NetworkBehaviourUpdater.NetworkBehaviourUpdater_Tick () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Core/NetworkBehaviourUpdater.cs:125)
Unity.Netcode.NetworkTickSystem.UpdateTick (System.Double localTimeSec, System.Double serverTimeSec) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Timing/NetworkTickSystem.cs:102)
Unity.Netcode.NetworkTimeSystem.UpdateTime () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Timing/NetworkTimeSystem.cs:139)
Unity.Netcode.NetworkManager.NetworkUpdate (Unity.Netcode.NetworkUpdateStage updateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Core/NetworkManager.cs:51)
Unity.Netcode.NetworkUpdateLoop.RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage updateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Core/NetworkUpdateLoop.cs:185)
Unity.Netcode.NetworkUpdateLoop+NetworkPreUpdate+<>c.<CreateLoopSystem>b__0_0 () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Core/NetworkUpdateLoop.cs:232)
There are no issues if there is just one client and no one disconnects, it will update completely fine. Also if a new client connects the error stops again. I am completely stumped.