IEnumerator CaptureAttackInput() { while (true) { yield return(new WaitForFixedUpdate()); yield return(new WaitUntil(() => ((Input.GetMouseButtonDown(0)) && (avatarIsAttacking == false)))); avatarIsAttacking = true; GetComponent <Animator>(). SetTrigger("Attack" + Random.Range(1, 3)); attackSFXPlayer.PlayAttackSFX(); yield return(new WaitForSeconds(0.666f)); avatarIsAttacking = false; } }