Should NetworkList being sync up on client connection?

Hi there!

I am using a NeworkList to sync a list of soldiers in my game.

It works fine if both clients are connected at the same time. However, if a client enters later ( o reconnects), the NetworkList is not synced.

To give more information,

Steps:

  1. Client A connects and add 3 items to the list
  2. Client B connects and see Client A prefab with 0 items in the list
  3. Client A add 1 more item to the list
  4. Client B receives 4 callbacks ( the 3 old items plus the new one) that the list has changed

Is this the expected behavior? I expected it to work like the NetworkVariable that will sync the values when a new client connects

I believe this was a bug in 1.0.2 that got fixed in 1.1.0. Try 1.1.0 if you aren’t on that version.

in 1.1.0 it doesn’t call OnValueChanged when connecting. I am using 1.0.2 and I am not having any problems with NetworkList

I got the same problem on both versions, I got them in 1.0.2 and tried uploading them to 1.1.0 but the same problem persists

Check the network list length in OnNetworkSpawn of the containing object, if the network list is working correctly it should contain the current values.

What you’re describing sounds like a bug to me though, it might be worth creating a Github issue for it.