diff --git a/QSB/Syncs/Sectored/Rigidbodies/SectoredRigidbodySync.cs b/QSB/Syncs/Sectored/Rigidbodies/SectoredRigidbodySync.cs index dc612ffb..e41f85c7 100644 --- a/QSB/Syncs/Sectored/Rigidbodies/SectoredRigidbodySync.cs +++ b/QSB/Syncs/Sectored/Rigidbodies/SectoredRigidbodySync.cs @@ -70,9 +70,10 @@ public abstract class SectoredRigidbodySync : BaseSectoredSync return; } - transform.position = ReferenceTransform.ToRelPos(AttachedRigidbody.GetPosition()); + var pos = AttachedRigidbody.GetPosition(); + transform.position = ReferenceTransform.ToRelPos(pos); transform.rotation = ReferenceTransform.ToRelRot(AttachedRigidbody.GetRotation()); - Velocity = ReferenceRigidbody.ToRelVel(AttachedRigidbody.GetVelocity(), AttachedRigidbody.GetPosition()); + Velocity = ReferenceRigidbody.ToRelVel(AttachedRigidbody.GetVelocity(), pos); AngularVelocity = ReferenceRigidbody.ToRelAngVel(AttachedRigidbody.GetAngularVelocity()); } diff --git a/QSB/Syncs/Unsectored/Rigidbodies/UnsectoredRigidbodySync.cs b/QSB/Syncs/Unsectored/Rigidbodies/UnsectoredRigidbodySync.cs index b0d3a6a5..99b5cc91 100644 --- a/QSB/Syncs/Unsectored/Rigidbodies/UnsectoredRigidbodySync.cs +++ b/QSB/Syncs/Unsectored/Rigidbodies/UnsectoredRigidbodySync.cs @@ -64,9 +64,10 @@ public abstract class UnsectoredRigidbodySync : BaseUnsectoredSync protected override void GetFromAttached() { - transform.position = ReferenceTransform.ToRelPos(AttachedRigidbody.GetPosition()); + var pos = AttachedRigidbody.GetPosition(); + transform.position = ReferenceTransform.ToRelPos(pos); transform.rotation = ReferenceTransform.ToRelRot(AttachedRigidbody.GetRotation()); - Velocity = ReferenceRigidbody.ToRelVel(AttachedRigidbody.GetVelocity(), AttachedRigidbody.GetPosition()); + Velocity = ReferenceRigidbody.ToRelVel(AttachedRigidbody.GetVelocity(), pos); AngularVelocity = ReferenceRigidbody.ToRelAngVel(AttachedRigidbody.GetAngularVelocity()); }