From f515d054c709a0004f6acc22e9c8c5503b198634 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 21 Jan 2023 17:08:07 -0800 Subject: [PATCH] sync transforms after moving player --- .../RaftSync/TransformSync/RaftTransformSync.cs | 5 +++++ QSB/ShipSync/TransformSync/ShipTransformSync.cs | 5 +++++ QSB/Syncs/Occasional/OccasionalTransformSync.cs | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/QSB/EchoesOfTheEye/RaftSync/TransformSync/RaftTransformSync.cs b/QSB/EchoesOfTheEye/RaftSync/TransformSync/RaftTransformSync.cs index 51494895..f7a3d9ed 100644 --- a/QSB/EchoesOfTheEye/RaftSync/TransformSync/RaftTransformSync.cs +++ b/QSB/EchoesOfTheEye/RaftSync/TransformSync/RaftTransformSync.cs @@ -102,6 +102,11 @@ public class RaftTransformSync : UnsectoredRigidbodySync, ILinkedNetworkBehaviou playerBody.SetPosition(AttachedTransform.FromRelPos(relPos)); playerBody.SetRotation(AttachedTransform.FromRelRot(relRot)); + + if (!Physics.autoSyncTransforms) + { + Physics.SyncTransforms(); + } } } else diff --git a/QSB/ShipSync/TransformSync/ShipTransformSync.cs b/QSB/ShipSync/TransformSync/ShipTransformSync.cs index 0fd5bc5a..5bd46328 100644 --- a/QSB/ShipSync/TransformSync/ShipTransformSync.cs +++ b/QSB/ShipSync/TransformSync/ShipTransformSync.cs @@ -74,6 +74,11 @@ public class ShipTransformSync : SectoredRigidbodySync playerBody.SetPosition(AttachedTransform.FromRelPos(relPos)); playerBody.SetRotation(AttachedTransform.FromRelRot(relRot)); + + if (!Physics.autoSyncTransforms) + { + Physics.SyncTransforms(); + } } } else diff --git a/QSB/Syncs/Occasional/OccasionalTransformSync.cs b/QSB/Syncs/Occasional/OccasionalTransformSync.cs index 32659d9c..d96ab318 100644 --- a/QSB/Syncs/Occasional/OccasionalTransformSync.cs +++ b/QSB/Syncs/Occasional/OccasionalTransformSync.cs @@ -75,6 +75,11 @@ public class OccasionalTransformSync : UnsectoredRigidbodySync AttachedRigidbody.SetAngularVelocity(ReferenceRigidbody.FromRelAngVel(AngularVelocity)); Move(); + + if (!Physics.autoSyncTransforms) + { + Physics.SyncTransforms(); + } } private readonly List _toMove = new(); @@ -125,4 +130,4 @@ public class OccasionalTransformSync : UnsectoredRigidbodySync _toMove.Clear(); } -} \ No newline at end of file +}