Skip to content

Netcode Issue(?) #3888

Description

@Magman3000

Description

A clear and concise description of what the bug is.

Reproduce Steps

When Hosting
NullReferenceException: Object reference not set to an instance of an object
Unity.Netcode.ListSerializer1[T].Duplicate (System.Collections.Generic.List1[T]& value, System.Collections.Generic.List1[T]& duplicatedValue) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/NetworkVariable/Serialization/TypedSerializerImplementations.cs:344) Unity.Netcode.ListSerializer1[T].Unity.Netcode.INetworkVariableSerializer<System.Collections.Generic.List>.Duplicate (System.Collections.Generic.List1[T]& value, System.Collections.Generic.List1[T]& duplicatedValue) (at <638f8b09672547aea8c59a993b0e0e73>:0)
Unity.Netcode.NetworkVariableSerialization1[T].Duplicate (T& value, T& duplicatedValue) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/NetworkVariable/Serialization/NetworkVariableSerialization.cs:155) Unity.Netcode.NetworkVariable1[T].OnInitialize () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/NetworkVariable/NetworkVariable.cs:60)
Unity.Netcode.NetworkVariableBase.Initialize (Unity.Netcode.NetworkBehaviour networkBehaviour) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/NetworkVariable/NetworkVariableBase.cs:125)
Chat.__initializeVariables () (at <1c349474cc5642378be2cfec158ae21f>:0)
Unity.Netcode.NetworkBehaviour.InitializeVariables () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkBehaviour.cs:1019)
Unity.Netcode.NetworkBehaviour.InternalOnNetworkSpawn () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkBehaviour.cs:789)
Unity.Netcode.NetworkObject.InvokeBehaviourNetworkSpawn () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkObject.cs:2566)
Unity.Netcode.NetworkSpawnManager.SpawnNetworkObjectLocallyCommon (Unity.Netcode.NetworkObject networkObject, System.UInt64 networkId, System.Boolean sceneObject, System.Boolean playerObject, System.UInt64 ownerClientId, System.Boolean destroyWithScene) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Spawning/NetworkSpawnManager.cs:1197)
Unity.Netcode.NetworkSpawnManager.AuthorityLocalSpawn (Unity.Netcode.NetworkObject networkObject, System.UInt64 networkId, System.Boolean sceneObject, System.Boolean playerObject, System.UInt64 ownerClientId, System.Boolean destroyWithScene) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Spawning/NetworkSpawnManager.cs:1093)
Unity.Netcode.NetworkSpawnManager.ServerSpawnSceneObjectsOnStartSweep () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Spawning/NetworkSpawnManager.cs:1505)
Unity.Netcode.NetworkManager.HostServerInitialize () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkManager.cs:1481)
Unity.Netcode.NetworkManager.StartHost () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkManager.cs:1437)
UnityEngine.Debug:LogException(Exception)
Unity.Netcode.NetworkManager:StartHost() (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkManager.cs:1442)
Buttons:Host() (at Assets/Scripts/GameState/Buttons.cs:11)
UnityEngine.EventSystems.EventSystem:Update() (at ./Library/PackageCache/com.unity.ugui@f33505fcd0e6/Runtime/UGUI/EventSystem/EventSystem.cs:514)

When trying to join as a client
[Netcode] A ConnectionRequestMessage was received from the server on the client side. NetworkTransport: Unity.Netcode.Transports.UTP.UnityTransport UnityTransportProtocol: UnityTransport. This should not happen. Please report this to the Netcode for GameObjects team at https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues and include the following data: Message Size: 170. Message Content: 02 02 7d 9a e2 a5 21 b2 36 17 b3 11 46 c4 ca 04 01 2a b2 f1 50 01 e9 3a b6 d2 01 39 3b e8 2c 01 ab c9 50 60 01 53 a3 38 44 21 d3 f6 1c b8 01 7f 10 0d af 01 f3 a2 4a 4a 01 a6 22 89 97 01 e9 4e 31 0d 01 b5 fe 01 74 11 be 97 be 73 01 bd 23 d8 d0 01 58 aa fb 1c 01 9d 9a 5c 01 01 e9 51 97 17 01 8a f7 e7 83 01 ee 80 1f c6 01 42 7f 88 c6 01 97 a3 f5 46 01 c2 40 2e a3 01 4e 67 03 d2 01 00 00 00 00 01 00 00 00 00 01 00 00 00 00 01 00 00 00 00 01 00 00 00 00 01 00 00 00 00 01 00 00 00 00 01 7b b0 63 b4 84 16 87 b7
UnityEngine.Debug:LogError (object)
Unity.Netcode.NetworkLog:LogError (string) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Logging/NetworkLog.cs:34)
Unity.Netcode.NetworkManagerHooks:OnVerifyCanReceive (ulong,System.Type,Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Messaging/NetworkManagerHooks.cs:95)
Unity.Netcode.NetworkMessageManager:CanReceive (ulong,System.Type,Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Messaging/NetworkMessageManager.cs:315)
Unity.Netcode.NetworkMessageManager:HandleMessage (Unity.Netcode.NetworkMessageHeader&,Unity.Netcode.FastBufferReader,ulong,single,int) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Messaging/NetworkMessageManager.cs:397)
Unity.Netcode.NetworkMessageManager:ProcessIncomingMessageQueue () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Messaging/NetworkMessageManager.cs:448)
Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkManager.cs:349)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkUpdateLoop.cs:191)
Unity.Netcode.NetworkUpdateLoop/NetworkEarlyUpdate/<>c:b__0_0 () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkUpdateLoop.cs:214)

Actual Outcome

When hosting player spawns as normal, but when trying to make a build join as a client, it won't join.

Expected Outcome

To be able to join as a client.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • OS: Windows
  • Unity Version: 6000.2.3f1
  • Netcode Version: 2.7.0 · October 31, 2025
  • Netcode Commit: (com.unity.netcode.gameobjects) ??
    • Netcode Topology: [e.g. Client-Server, Distributed Authority, etc.]
      -Unity Transport: 2.6.0
      -Mono Cecil: 1.11.4

Additional Context

Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions