Skip to content

NetworkList contains duplicate entries when its NetworkObject becomes visible to Client #2454

@A1win

Description

@A1win

Description

When network visibility of a NetworkObject changes from hidden to visible for a Client and the NetworkObject contains a NetworkList, the list contains duplicate entries when it's synced from Server to Client.

Steps to Reproduce

  1. Instantiate a NetworkObject no, set no.CheckObjectVisibility = (clientId) => false, and spawn the NetworkObject (which is now hidden to all Clients).
  2. On the Server, add an entry in a NetworkList that's attached to the NetworkObject. Check its contents on the Server.
  3. Make the NetworkObject visible to a Client. Check the contents of the NetworkList on the Client. Notice that it contains the added entry in it twice instead of once.

I haven't reproduce this on a small test project and the steps above might not be exactly correct. Try adding/removing items from the NetworkList before and after making the NetworkObject visible to the Client and check if it's synced correctly.

Expected Outcome

NetworkList is always synchronized correctly from Server to Client.

Environment

  • OS: Windows 10
  • Unity version: 2021.3.19f1
  • Netcode version: 1.2.0

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