set rb not tf

This commit is contained in:
mischa 2024-04-02 23:24:03 +08:00
parent 2775fd67ff
commit be8776473d

View File

@ -271,9 +271,9 @@ void UpdateClient()
// Quaternions always need to be normalized in order to be a valid rotation after operations // Quaternions always need to be normalized in order to be a valid rotation after operations
Quaternion newRotation = Quaternion.Slerp(currentRotation, lastReceivedState.rotation, rotationBlendingSpeed * deltaTime).normalized; Quaternion newRotation = Quaternion.Slerp(currentRotation, lastReceivedState.rotation, rotationBlendingSpeed * deltaTime).normalized;
// assign rigidbody position & rotation while keeping velocity to keep moving
// assign position and rotation together. faster than accessing manually. predictedRigidbody.MovePosition(newPosition);
tf.SetPositionAndRotation(newPosition, newRotation); predictedRigidbody.MoveRotation(newRotation);
// blend for 2 x syncinterval. // blend for 2 x syncinterval.
// TODO configurable // TODO configurable