[NOT RESOLVED] Animation Controller - Javascript now C#

Hi guys!

I’m struggling trying to understand how to utilise the Animation Controller with javascript code.

I believe i need to use something like this to set it up but I’m not sure how to actually play an animation such as ‘yawn’ then fall back to ‘idle’

 var animator : Animator;
 
 function Start () {
     animator = GetComponent("Animator");

    MyPlayAnimation("yawn");
 }
 

function MyPlayAnimation(theAnimation){
  //code to play animation??
}

You have a great deal to learn.

Start with this tutorial:

How do you plan to trigger the “yawn” then “idle” animation? Are you talking about using keyboard input, a timer, or something else?