fix: NetworkLerpRigidbody now uses double time to keep precision over multiple days

This commit is contained in:
vis2k 2022-10-26 12:19:44 +02:00
parent 25d0e7929a
commit 5abc261320

View File

@ -16,7 +16,7 @@ public class NetworkLerpRigidbody : NetworkBehaviour
[Tooltip("Set to true if moves come from owner client, set to false if moves always come from server")]
[SerializeField] bool clientAuthority = false;
float nextSyncTime;
double nextSyncTime;
[SyncVar()]
@ -61,7 +61,7 @@ void SyncToClients()
void SendToServer()
{
float now = Time.time;
double now = NetworkTime.localTime; // Unity 2019 doesn't have Time.timeAsDouble yet
if (now > nextSyncTime)
{
nextSyncTime = now + syncInterval;