Hi all,
I am getting a behaviour with a SyncListStruct that I do not understand.
I have implemented a SyncListStruct which is successfully synchronising across the network. I query the list inside the [SyncListChanged] callback to retrieve the latest values. On clients, this works as expected. However, on the host I receive the state of the list before the sync. If I then query the SyncListStruct again a second or so after the callback has fired, I receive the latest list correctly.
The behaviour I am seeing suggests that the [SyncListChanged] callback is triggered slightly early on hosts only. Could this be possible? This is especially strange to me as the server is the one who updated the list originally, which is then synced to clients.
Briefly, my set up is not complex:
-
A SyncListStruct using an empty derived class, as outlined here: http://docs.unity3d.com/ScriptReference/Networking.SyncListStruct_1.html
-
The struct consists of a [NetworkInstanceId] and an [int].
-
Listening for changes to the list using SyncListChanged callback, as described here: http://docs.unity3d.com/ScriptReference/Networking.SyncList_1.SyncListChanged.html
-
Unity 5.1.0f3
Thanks in advance,
Andy