IEnumerator animationLoop() { bool wait; foreach (Action stage in animations) { //Wait until previous animation has finished before moving onto the next one wait = true; while (wait) { if (!syringe.animationRunning() && !needle.animationRunning() && !model.animationRunning() && !container.animationRunning()) { stage(); //Run relevant stage wait = false; } yield return(new WaitForSeconds(.05f)); } } }