Skip to content

Commit a04a177

Browse files
style
Adding a comment about the change
1 parent 07575a5 commit a04a177

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

com.unity.netcode.gameobjects/Runtime/Timing/NetworkTimeSystem.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ public void Sync(double serverTimeSec, double rttSec)
248248
var timeDif = serverTimeSec - m_TimeSec;
249249

250250
m_DesiredServerTimeOffset = timeDif - ServerBufferSec;
251+
// We adjust our desired local time offset to be half RTT since the delivery of
252+
// the TimeSyncMessage should only take half of the RTT time (legacy was using 1 full RTT)
251253
m_DesiredLocalTimeOffset = timeDif + (rttSec * 0.5d) + LocalBufferSec;
252254
}
253255
}

0 commit comments

Comments
 (0)