public void FixedUpdate() { if (CurrentProgress <= 0 && Direction == -1 || CurrentProgress >= TransitionDuration && Direction == 1) { return; } CurrentProgress += Direction * Time.deltaTime; transform.localPosition = Vector3.Lerp(StartPosition, EndPosition, LerpHelper.SmoothStep2(CurrentProgress / TransitionDuration)); }