From 4643d01573f225c16ec774d9b9014ccb7c299178 Mon Sep 17 00:00:00 2001 From: mischa Date: Tue, 9 Apr 2024 11:39:34 +0800 Subject: [PATCH] comments --- .../Mirror/Components/ForecastRigidbody/ForecastRigidbody.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/Mirror/Components/ForecastRigidbody/ForecastRigidbody.cs b/Assets/Mirror/Components/ForecastRigidbody/ForecastRigidbody.cs index 90b7ba829..445f56f1a 100644 --- a/Assets/Mirror/Components/ForecastRigidbody/ForecastRigidbody.cs +++ b/Assets/Mirror/Components/ForecastRigidbody/ForecastRigidbody.cs @@ -313,6 +313,8 @@ void FixedUpdateClient() // in theory we must always set rigidbody.position/rotation instead of transform: // https://forum.unity.com/threads/how-expensive-is-physics-synctransforms.1366146/#post-9557491 // however, tf.SetPositionAndRotation is faster in our Prediction Benchmark. + // predictedRigidbody.position = newPosition; + // predictedRigidbody.rotation = newRotation; tf.SetPositionAndRotation(newPosition, newRotation); // transition to FOLLOWING after blending is done. @@ -333,6 +335,8 @@ void FixedUpdateClient() // https://forum.unity.com/threads/how-expensive-is-physics-synctransforms.1366146/#post-9557491 // however, tf.SetPositionAndRotation is faster in our Prediction Benchmark. // TODO snapshot interpolation + // predictedRigidbody.position = lastReceivedState.position; + // predictedRigidbody.rotation = lastReceivedState.rotation; tf.SetPositionAndRotation(lastReceivedState.position, lastReceivedState.rotation); } }