I am trying to play a animation with script. I created a Animation Controller created a new state added a script to it that says
void Update () { if(Input.GetKeyDown(KeyCode.Mouse0)) { Animation.Play("Falling"); } }
Now when I try to play my game it says error CS0120: An object reference is required to access non-static member UnityEngine.Animation.Play()'` Can someone help me?
Animation is a class. You want the instance of that class attached to this Gameobject. I.e.
GetComponent<Animation>().Play("Falling");