SyncTypes
Last updated
Last updated
Like, SyncTypes are another type of . These are fields which automatically synchronize over the network to clients when the server changes them. There are a variety of SyncTypes available: SyncVar, SyncDictionary, SyncList, custom SyncTypes, and more.
When changes are made to a SyncType, only the changes are sent. For example, if you have a SyncList of 10 values and add another, only the just added entry will be sent.
SyncTypes will also for custom types.
There is a small limitation with all SyncTypes when running both the client and server in a single build.
While as clientHost, the previous value, when applicable, in callbacks will be the current value if the asServer parameter is false. This is mostly noticed in SyncVars, note the example below.
There is a fairly simple way to accommodate this scenario if you plan on using clientHost in your game.