Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Bug NetworkObject destroyed without apparent reason

Discussion in 'Netcode for GameObjects' started by AnKOu, Jul 23, 2021.

  1. AnKOu

    AnKOu

    Joined:
    Aug 30, 2013
    Posts:
    123
    Hello !

    I have an issue where scene NetworkObject get destroyed on connection.

    I found out that it was a call to NetworkSpawnManager::CleanDiffedSceneObjects() which destroy them.

    The list used by this method to destroy those gameObject is filled in NetworkSpawnManager::ClientCollectSoftSyncSceneObjectSweep(). Apparently, all the scene NetworkObject whose IsSceneObject property is null are added to the list.

    When looking in the source of NetworkObject, it says that
    So my question is why those 6 NetworkObject aren't spawned like their 164 siblings in the same scene ?
    Given the fact that I start the client after waiting for the server to be fully started and that on the server, those NetworkObject are indicated as spawned.

    Do you think this is a bug ? Should I report it ?