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.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Mirror: How should I use SyncList to sync a list on both client and server

Discussion in 'Multiplayer' started by TorontoDurant, Oct 3, 2022.

  1. TorontoDurant


    Jul 26, 2022
    Hello, I met a problem when using SyncList. I have a SyncList<group> groupList and every group has a guid. I called groupList.Add(A) in a command function and found the guid of group received by the callback is different from A.

    Code (CSharp):
    1.  var newGroup = new ActivityGroup();
    2. newGroup.GUID = System.Guid.NewGuid().ToString();
    3. groupList.Add(newGroup);
    I tried to output the guid in callback function and found it's null