How to add WAKE_UP animation before the character enters IDLE state?

Hi, i have a character in my game on which I want to execute the animation “Wake Up”, before the I can move the object around. I think the way my Animator Controller handles that is incorrect. I have two BOOL parameter isAwake and isIDLE which I handle though C# scripts. See scripts below:


Script for character:

private void Start () {

        //Store GameObject's Components
        animator = GetComponent<Animator>(); //Get Animator Controller
        controller = GetComponent<CharacterController>(); //Get Character Controller
        rb = GetComponent<Rigidbody>(); //Get Rigid Body
        MyCameraPrefab = Camera.main; 
        EffectsAudioSourceController = GetComponent<AudioSource>(); //Set Audio

        animator.SetBool("isAwake", false);
        animator.SetBool("isIDLE", false);
}

// Update is called once per 
private void Update () {

    /* (RE)SET ANIMATION - IDLE */
    if (animator.GetBool("isAwake") == true && animator.GetBool("isIDLE") == true)
    {
        Animation_IDLE();
    }

//CALL THIS FROM ANOTHER SCRIPT
public void Animation_WakeUP() {
        animator.SetBool("isIDLE", false);
        animator.SetBool("isAwake", true);
}

public void Animation_IDLE() {
     animator.SetBool("isIDLE", true);
}

Then i want a specific moment on where all the animations should begin. For example a camera object will move around as shown in the example here. When the animation of the camera ends, the TriggerWakeUP() function is called, which then call the Animation_WakeUP().

public class DialogueTrigger1 : MonoBehaviour {

    public Dialogue dialogue;
    public GameObject playerPrefab;
    public Animator playerAnimator;
    
    public void TriggerWakeUP() {

        FindObjectOfType<DialogueManager>().StartDialogue(dialogue);
        FindObjectOfType<Movements>().Animation_WakeUP();
    }
}

As you can see from the provided link this will execute the animation as soon as the player is loaded. How to prevent this, so that i can call the beginning of animation at any point?

Or can i set a different animator ?

The default state, the orange one, is the state the animator starts in when it is entered - in your case when it is created.

So you’ll have to add another state that has an empty animation as the default state if you don’t want it to do anything at all until isAwake is set.