Unity-Technologies / com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.15k stars 435 forks source link

InvalidOperationException: Nullable object must have a value. #2951

Open StephenGrosjean opened 5 months ago

StephenGrosjean commented 5 months ago

Description

When a client join a game this error is showing, but only on 1.9.1 not on 1.8.1. The client is not spawning any network prefab. No other issue than this one at the same time.

Reproduce Steps

Can't find any general step to reproduce.

Actual Outcome

A clear and concise description of what happened and broke.

Environment

Additional Context


System.Nullable`1[T].get_Value () (at <17d9ce77f27a4bd2afb5ba32c9bea976>:0)
Unity.Netcode.NetworkObject.HostCheckForGlobalObjectIdHashOverride () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Core/NetworkObject.cs:2040)
Unity.Netcode.NetworkObject.GetMessageSceneObject (System.UInt64 targetClientId) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Core/NetworkObject.cs:1764)
Unity.Netcode.SceneEventData.WriteSceneSynchronizationData (Unity.Netcode.FastBufferWriter writer) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/SceneManagement/SceneEventData.cs:530)
Unity.Netcode.SceneEventData.Serialize (Unity.Netcode.FastBufferWriter writer) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/SceneManagement/SceneEventData.cs:476)
Unity.Netcode.SceneEventMessage.Serialize (Unity.Netcode.FastBufferWriter writer, System.Int32 targetVersion) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Messaging/Messages/SceneEventMessage.cs:15)
Unity.Netcode.NetworkMessageManager.SendMessage[TMessageType,TClientIdListType] (TMessageType& message, Unity.Netcode.NetworkDelivery delivery, TClientIdListType& clientIds) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Messaging/NetworkMessageManager.cs:641)
Unity.Netcode.NetworkMessageManager.SendMessage[T] (T& message, Unity.Netcode.NetworkDelivery delivery, System.UInt64 clientId) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Messaging/NetworkMessageManager.cs:814)
Unity.Netcode.NetworkConnectionManager.SendMessage[T] (T& message, Unity.Netcode.NetworkDelivery delivery, System.UInt64 clientId) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Connection/NetworkConnectionManager.cs:1282)
Unity.Netcode.NetworkSceneManager.SynchronizeNetworkObjects (System.UInt64 clientId) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/SceneManagement/NetworkSceneManager.cs:1839)
Unity.Netcode.NetworkConnectionManager.HandleConnectionApproval (System.UInt64 ownerClientId, Unity.Netcode.NetworkManager+ConnectionApprovalResponse response) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Connection/NetworkConnectionManager.cs:823)
Unity.Netcode.ConnectionRequestMessage.Handle (Unity.Netcode.NetworkContext& context) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Messaging/Messages/ConnectionRequestMessage.cs:156)
Unity.Netcode.NetworkMessageManager.ReceiveMessage[T] (Unity.Netcode.FastBufferReader reader, Unity.Netcode.NetworkContext& context, Unity.Netcode.NetworkMessageManager manager) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Messaging/NetworkMessageManager.cs:582)
Unity.Netcode.NetworkMessageManager.HandleMessage (Unity.Netcode.NetworkMessageHeader& header, Unity.Netcode.FastBufferReader reader, System.UInt64 senderId, System.Single timestamp, System.Int32 serializedHeaderSize) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Messaging/NetworkMessageManager.cs:446)
UnityEngine.Debug:LogException(Exception)
Unity.Netcode.NetworkMessageManager:HandleMessage(NetworkMessageHeader&, FastBufferReader, UInt64, Single, Int32) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Messaging/NetworkMessageManager.cs:450)
Unity.Netcode.NetworkMessageManager:ProcessIncomingMessageQueue() (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Messaging/NetworkMessageManager.cs:472)
Unity.Netcode.NetworkManager:NetworkUpdate(NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Core/NetworkManager.cs:49)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage(NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Core/NetworkUpdateLoop.cs:192)
Unity.Netcode.<>c:<CreateLoopSystem>b__0_0() (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.9.1/Runtime/Core/NetworkUpdateLoop.cs:215)```
fluong6 commented 5 months ago

Thank you for reaching out and reporting the issue. We wanted to let you know that we will be releasing NGO version 1.10 soon, which included numerous updates and fixes that may address the problem you've encountered.

Once it's available, please update to this new version and check if the issue persists. Stay tuned.