fix(NetworkTransformReliable): Include sendInterval in AddSnapshot

This commit is contained in:
MrGadget1024 2023-03-14 06:36:27 -04:00
parent 69de3f0379
commit 373e65ac37

View File

@ -298,7 +298,7 @@ protected virtual void OnClientToServerSync(Vector3? position, Quaternion? rotat
// Debug.Log($"{name}: corrected history on server to fix initial stutter after not sending for a while.");
}
AddSnapshot(serverSnapshots, connectionToClient.remoteTimeStamp, position, rotation, scale);
AddSnapshot(serverSnapshots, connectionToClient.remoteTimeStamp + NetworkServer.sendInterval, position, rotation, scale);
}
// server broadcasts sync message to all clients
@ -322,7 +322,7 @@ protected virtual void OnServerToClientSync(Vector3? position, Quaternion? rotat
// Debug.Log($"{name}: corrected history on client to fix initial stutter after not sending for a while.");
}
AddSnapshot(clientSnapshots, NetworkClient.connection.remoteTimeStamp, position, rotation, scale);
AddSnapshot(clientSnapshots, NetworkClient.connection.remoteTimeStamp + NetworkClient.sendInterval, position, rotation, scale);
}
// only sync on change /////////////////////////////////////////////////