Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug If NetworkList is updated immediately after Spawn, NetworkList is not synchronized with the client.

Discussion in 'Netcode for GameObjects' started by modaka-cov, Jul 13, 2022.

  1. modaka-cov


    Jul 5, 2021
    If I spawn a NetworkBehaviour with a NetworkList while the client is connected, the NetworkList does not seem to be synchronized with the client.

    this is reproduction project.

    The following two scripts are important.

    NetworkListHolder is a NetworkBehaviour with a NetworkList.

    The NetworkListHolderGenerator spawn a NetworkObject to which the NetworkListHolder is attached and then updates the NetworkList.
    I prepared three patterns for the timing of updating.

    1. before spawn
    2. after spawn
    3. 1 second after spawn

    In patterns 1 and 2, the NetworkList will not be synced to the client.
    Only in pattern 3 the NetworkList is synced to the client.

    If I replace NetworkList with NetworkVariable in this reproduction project, all patterns are synchronized to the client I would like NetworkList to have the same behavior.
  2. cerestorm


    Apr 16, 2020
    modaka-cov likes this.