public IEnumerator DealerAnimation() { float firstAnimationDelay = 0.7f; float secondAnimationDelay = 0.7f; GameObject.Find("MillerDealer").GetComponent <Animator>().SetBool("DealSequence", true); //Starts dealer animation yield return(new WaitForSeconds(firstAnimationDelay)); //waits for specified time delay defHero.PlaySound1(); //plays sound yield return(new WaitForSeconds(secondAnimationDelay)); //waits for specified time delay GameObject.Find("MillerDealer").GetComponent <Animator>().SetBool("DealSequence", false); //Stops dealer animation }