"Unknown message ID 50 connId:1", likely related to a SyncVar (SyncListStruct)

It looks like my clients are unable to receive things from a SyncVar. Clients get this message when they join a server:

Unknown message ID 50 connId:1
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
UnityEngine.Networking.NetworkConnection:HandleMessage(Dictionary`2, NetworkReader, Int32, Int32) (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkConnection.cs:338)
UnityEngine.Networking.NetworkClient:Update() (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkClient.cs:472)
UnityEngine.Networking.NetworkClient:UpdateClients() (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkClient.cs:686)
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate() (at C:\buildslave\unity\build\Extensions\Networking\Runtime\NetworkIdentity.cs:725)
 
(Filename: C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkConnection.cs Line: 338)

However, after this point, everything seems to work, apart from the fact that they don’t get the initial values.

I have this:

public class SyncListPlayerInfo : SyncListStruct<PlayerInfo> {

}

And this:

[SyncVar( hook = "OnPlayerListChange" )]
public SyncListPlayerInfo players = new SyncListPlayerInfo();

Am I missing something? :slight_smile:

SyncLists are not SyncVars. Remove the SyncList attribute from the “players” variable.

There is a SyncListChanged delegate on the SyncList called Callback that allows you to handle changes on the client.