This commit is contained in:
Aleksander Waage 2020-08-14 19:46:58 +02:00
parent e64cbd28ec
commit c77fe339f6

View File

@ -97,14 +97,9 @@ namespace QSB.TransformSync
} }
SyncedTransform.parent = ReferenceTransform; SyncedTransform.parent = ReferenceTransform;
if (SyncedTransform.parent == _previousTransform) SyncedTransform.localPosition = SyncedTransform.parent == _previousTransform
{ ? Vector3.SmoothDamp(SyncedTransform.localPosition, transform.position, ref _positionSmoothVelocity, SmoothTime)
SyncedTransform.localPosition = Vector3.SmoothDamp(SyncedTransform.localPosition, transform.position, ref _positionSmoothVelocity, SmoothTime); : transform.position;
}
else
{
SyncedTransform.localPosition = transform.position;
}
_previousTransform = SyncedTransform.parent; _previousTransform = SyncedTransform.parent;
SyncedTransform.localRotation = QuaternionHelper.SmoothDamp(SyncedTransform.localRotation, transform.rotation, ref _rotationSmoothVelocity, Time.deltaTime); SyncedTransform.localRotation = QuaternionHelper.SmoothDamp(SyncedTransform.localRotation, transform.rotation, ref _rotationSmoothVelocity, Time.deltaTime);