Skip to content

NullException in NetworkObject.Deserialize when it logs a warning AND the object failed #4071

Description

@zachstronaut

Netcode 2.12.0

This Warning will generate a null exception if succeeded from NonAuthorityLocalSpawn is false.

NetworkLog.LogWarning($"[{networkObject.name}][Deserialize][{nameof(NetworkBehaviour)}Synchronization][Size mismatch] Expected: {endOfSynchronizationData} Currently At: {reader.Position}!");

You can't access networkObject.name if the spawn success bool is false.

Aside:

I'm not sure what we just changed (working on it, heh) but now when we load one of our scenes I am seeing:

[Netcode] Trying to spawn a NetworkObject with a NetworkObjectId of 65 but an object with that id is already in the spawned list. This should not happen!
[Netcode] [null][Deserialize][NetworkBehaviourSynchronization][Size mismatch] Expected: 7519 Currently At: 7518!

This is how I found your null exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions