// Slides under objects public IEnumerator SlideCoroutine() { this.State = PlayerState.sliding; float slideTimer = 0f; this.collider.height = 0.3f; this.collider.center = new Vector3(0, -0.70f, 0); camera.AnimateEnterSlide(); yield return(0); while (slideTimer < slideTime) { MoveCharacter(1, 0); slideTimer += Time.deltaTime; yield return(0); } camera.AnimateExitSlide(); this.collider.height = 2f; this.collider.center = new Vector3(0, 0, 0); this.State = PlayerState.moving; }