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
Quaternion newRotation = Quaternion.Slerp(currentRotation, lastReceivedState.rotation, rotationBlendingSpeed * deltaTime).normalized;
// assign position and rotation together. faster than accessing manually.
tf.SetPositionAndRotation(newPosition, newRotation);
// assign rigidbody position & rotation while keeping velocity to keep moving
predictedRigidbody.MovePosition(newPosition);
predictedRigidbody.MoveRotation(newRotation);
// blend for 2 x syncinterval.
// TODO configurable