Through some research I found some code that should wait until an animation is done playing i a Courtine like format, here’s the code:

Extension method:

public static IEnumerator WhilePlaying(this Animation animation,  string animationName) {
     animation.Play(animationName);
     yield return animation.WhilePlaying(animationName);
 }

Here’s how it’s implemented:

	IEnumerator TriggerAnimation(bool last) {
		Debug.Log("Start");
		yield return StartCoroutine(QuizHandler.Singleton.animation.WhilePlaying("NextQuestionAnim"));
		Debug.Log("Finish");
		yield return StartCoroutine(QuizHandler.Singleton.animation.WhilePlaying("NextQuestionAnim"));
		Debug.Log("Test");
	}

The console prints out “Start”, “Finish”, and “Test” all at the same time, and even though it should be waiting for the animation to finish before continuing on, the animation also only plays once, which tells me that this isn’t working at all.

This has already been asked.

Hope it helps :smiley: