SyncVar Hook does not get called when a new player joins

Hey,
I am currently learning the new networking system and I don’t know if this is a bug or intended: I am using a SyncVar to sync the playername across the network, if it changed I call a function to update the visible Text above the player to show his name. This works fine, except when a new player joins. The Variable gets synced on the new client for the old players, but the hook is not called. Is there an easy fix for this? I tried to set the DirtyBit to 1u (since it’s the first variable) but that didn’t do anything because the value didn’t change!

Edit: For now I fixed this by checking at the Start if the value is different than the default. However this might cause problems with high latency if the value gets updated after the Start function, so this is no real fix…

Thanks for your help!

For now the hook are not called, you can do it manually in the OnStartClient callback for example.

So is this a bug or intended? I just want to know if this will be fixed in the next patch or if I have to adjust my code to make it work :slight_smile:

For now this seems to be a feature.

http://docs.unity3d.com/Manual/UNetStateSync.html