bool IsTouchingRail() { bool isTouching = Mathf.Approximately( Mathf.Abs(transform.position.y), Mathf.Abs(nextWaypoint.transform.position.y) ); animController.SetJumping(!isTouching); return(isTouching); }