Blending animations with mixing transform

A good day!

I’m having a trouble understanding how to manage animations with and without mixing transforms. So I have a Walking(full body), Tired(full body) and Breathing(target is chest) animation. What I want to achieve make the character stop walking then play the Tired animation with Breathing animation. The game will then wait for the Tired animation to reach it’s end while Breathing is still playing before enabling the user to close a dialogbox. After closing the dialog box, blend the animation to Idle pose(full body animation; no mixing). How can I achieve that effect?

Here’s my code so far:

using UnityEngine;
using System.Collections;

public class PheneloCustomAnimation : MonoBehaviour {
	
	public Transform skeleton;
	public bool doingAnimation, canStopAnim;
	public float tempLayer;
	
	public IEnumerator Tired()
	{
		doingAnimation = true;
		Transform chest = skeleton.Find("hips/spine/chest");
		animation["Idle"].layer = 2;
		animation["Tired"].layer = 1;
		animation["Tired"].wrapMode = WrapMode.ClampForever;
		animation.Stop("Walk");
		animation["Idle"].AddMixingTransform(chest);
		animation.Play("Tired");
		while(doingAnimation)
		{
			//This thing is for giving time for the animation to reach its end
			//before the user can close the conversation dialog box
			Debug.Log(animation["Tired"].time);
			if(animation["Tired"].time >= animation["Tired"].length)
			{
				canStopAnim = true;
			}
			yield return null;
		}
		//animation["Idle"].RemoveMixingTransform(chest);
		
		//animation["Idle"].layer = 0;
		//animation.RemoveClip(animation["Idle"].clip);
		//animation.Stop("Tired");
		//animation["Idle"].weight = 0.0f;
	}
}

If I can figure this out it will be a great help in saving time coding the other behaviors. Would someone help me with this?

Much thanks in advance! :smiley:

Oh well. No need. I just didn’t search that much though. Found an awesome answer here by Owen Reynolds. Pretty much explained about animation blending, layers and such.