Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Does SyncVar use networking bandwidth if I NEVER change the value?

Discussion in 'Multiplayer' started by iSleepzZz, May 30, 2018.

  1. iSleepzZz

    iSleepzZz

    Joined:
    Dec 23, 2012
    Posts:
    206
    Hey guys... Just curious, I would like to know if the sync variables use any bandwidth if I never change their value?
    For example, all players have a syncvar "test" set to "hello". If I never change the value, is the server still sending to the client's the new value is "hello". or does it know its the same value as our current one, so don't use any networking at all?

    Let me know, if you know! Thanks :)
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,732
    To the best of my knowledge a syncvar should only send network traffic when its value changes.
     
  3. Driiades

    Driiades

    Joined:
    Oct 27, 2015
    Posts:
    151
    I confirm, nope it will not charge network.
    But care because if you update 1 var in a script that contain 2-8 vars, it send an extra byte.
     
    iSleepzZz likes this.
  4. iSleepzZz

    iSleepzZz

    Joined:
    Dec 23, 2012
    Posts:
    206
    Awesome! That is great news.
    Thanks for the info :)