private void Update() { if (CurrentController != null) { Vector3 posOffset = CurrentController.ActuallySprintingAndMoving() ? SprintingAttachPointPositionOffset : AttachPointPositionOffset; Vector3 rotOffset = CurrentController.ActuallySprintingAndMoving() ? SprintingAttachPointRotationOffset : AttachPointRotationOffset; transform.localPosition = attachPosSkipLerp ? posOffset : Vector3.Lerp(transform.localPosition, posOffset, Time.deltaTime * LerpSpeed); Quaternion newRotation = Quaternion.Euler(rotOffset); transform.localRotation = attachPosSkipLerp ? newRotation : Quaternion.Lerp(transform.localRotation, newRotation, Time.deltaTime * LerpSpeed); if (attachPosSkipLerp) { attachPosSkipLerp = false; } /* Vector3 rot = transform.localRotation.eulerAngles; * rot.x = 0; * transform.localRotation = Quaternion.Euler(rot);*///AttachPointRotationOffset /*Vector3 posOffset = CurrentController.Motor.ActuallySprintingAndMoving() ? SprintingAttachPointPositionOffset : AttachPointPositionOffset; * rb.MovePosition(CurrentController.AlienAttachPoint.localPosition + posOffset); * * Vector3 rot = CurrentController.AlienAttachPoint.localRotation.eulerAngles; * rot.x = 0; * rb.MoveRotation(Quaternion.Euler(rot + AttachPointRotationOffset));*/ } }