IEnumerator moveCooldown(int frames) { this.GetComponent <SpriteRenderer>().flipX = !this.GetComponent <SpriteRenderer>().flipX; canMove = false; yield return(HushPuppy.WaitUntilNFrames(frames)); canMove = true; this.GetComponent <SpriteRenderer>().flipX = !this.GetComponent <SpriteRenderer>().flipX; rb.velocity = new Vector2(0f, rb.velocity.y); }