Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

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:
    280
    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