sync transforms after moving player

This commit is contained in:
JohnCorby 2023-01-21 17:08:07 -08:00
parent 072c3e95a5
commit f515d054c7
3 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -74,6 +74,11 @@ public class ShipTransformSync : SectoredRigidbodySync
playerBody.SetPosition(AttachedTransform.FromRelPos(relPos));
playerBody.SetRotation(AttachedTransform.FromRelRot(relRot));
if (!Physics.autoSyncTransforms)
{
Physics.SyncTransforms();
}
}
}
else

View File

@ -75,6 +75,11 @@ public class OccasionalTransformSync : UnsectoredRigidbodySync
AttachedRigidbody.SetAngularVelocity(ReferenceRigidbody.FromRelAngVel(AngularVelocity));
Move();
if (!Physics.autoSyncTransforms)
{
Physics.SyncTransforms();
}
}
private readonly List<MoveData> _toMove = new();
@ -125,4 +130,4 @@ public class OccasionalTransformSync : UnsectoredRigidbodySync
_toMove.Clear();
}
}
}