mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-19 03:39:50 +00:00
check ground body
This commit is contained in:
parent
ceb899d985
commit
3d43f26816
@ -10,7 +10,13 @@ namespace QSB.EchoesOfTheEye.RaftSync.TransformSync;
|
||||
|
||||
public class RaftTransformSync : UnsectoredRigidbodySync, ILinkedNetworkBehaviour
|
||||
{
|
||||
private bool ShouldMovePlayer => Vector3.Distance(AttachedTransform.position, Locator.GetPlayerBody().GetPosition()) < 10;
|
||||
private bool ShouldMovePlayer =>
|
||||
Locator.GetPlayerController() &&
|
||||
(
|
||||
Locator.GetPlayerController().GetGroundBody() == null ||
|
||||
Locator.GetPlayerController().GetGroundBody() == AttachedRigidbody
|
||||
) &&
|
||||
Vector3.Distance(AttachedTransform.position, Locator.GetPlayerBody().GetPosition()) < 10;
|
||||
protected override bool UseInterpolation => !ShouldMovePlayer;
|
||||
|
||||
private float _lastSetPositionTime;
|
||||
|
@ -118,6 +118,12 @@ public class ShipTransformSync : SectoredRigidbodySync
|
||||
#endregion
|
||||
|
||||
|
||||
private bool ShouldMovePlayer => Vector3.Distance(AttachedTransform.position, Locator.GetPlayerBody().GetPosition()) < 20;
|
||||
private bool ShouldMovePlayer =>
|
||||
Locator.GetPlayerController() &&
|
||||
(
|
||||
Locator.GetPlayerController().GetGroundBody() == null ||
|
||||
Locator.GetPlayerController().GetGroundBody() == AttachedRigidbody
|
||||
) &&
|
||||
Vector3.Distance(AttachedTransform.position, Locator.GetPlayerBody().GetPosition()) < 100;
|
||||
protected override bool UseInterpolation => !ShouldMovePlayer;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user