Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Network.time

Discussion in 'Multiplayer' started by jeremyace, Dec 9, 2007.

  1. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    Is a Client's Network.time supposed to try to sync with the Server's time? Because it isn't.

    In my tests on a local network between PC (webplayer) and Mac, the network time on the PC starts around 14252 while the Mac time starts at 41 (in this case) and of course varies as it goes, and each time you start it.

    If that's how it's supposed to work, that's fine, but obviously I'd like to know either way. ;-)

    Thanks
    -Jeremy

    PS: Unity 2.0 btw.
     
  2. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    274
    Network.time doesn't work that way. Checking it individually on the server and client will not give any useful information as it can show completely different numbers (as you have seen).

    You can use it as relative time compared to the timestamps you get in NetworkMessageInfo. There are internal adjustments to make up for different local system times.
     
  3. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    Ok, thanks for clearing that up Larus.

    -Jeremy