I can’t find a way to sync time between client and server. It is essential for lag compensation. I used to have Network.Time but it doesn’t work with the new hlapi. I tried using commands and rpc to calculate the difference but Time.time is very unstable and stops when you drag a window for example so any synchronisation breaks without any warning. And it’s not trivial to get a good sync precision. Got any advice?
Nevermind. It seems Network.Time works again for unet in 5.2 !
1 Like
But it looks like, it doesn’t work across platforms (e.g.: windows vs. linux)
On same machine worked. But doesn’t work between mac & window.
Didn’t try window with windows-windows yet.
I’ve found the solution for this problem. I’ve post my answer here :
Let take a look.
“The idea is : when a client connected to our Server, the server will send the current Network.time value to that client, the client will save the timeStamp received from Server, and update it on each frame (syncServerTime += Time.deltaTime ). So, we’ll have the syncServerTime field that be sync on both Server and connected clients.”
1 Like