WTF does this error mean

im teaching myself how to create and script animations by myself and so far so good the creating part was easy but i cant figure out what the correct scripting is to make the animation play at the right time so this errors keep showing up

An instance of type ‘UnityEngine.Animation’ is required to access non static member ‘Stop’.
An instance of type ‘UnityEngine.Animation’ is required to access non static member ‘Play’.

and heres the lines of scripts that those errors are referencing

if(Input.GetButton(“run”))

{

Animation.Play(“runninganimations”);

}

else

{

Animation.Stop(“runninganimations”);

}

It means you need to create an Animation object and call the Play and Stop functions from that object. Create an empty gameobject and add an Animation component to it. Import it into the script with a public inspector variable, and call your methods from that.

This is what your code should look like;

public Animation RunningAnimation;

void Update()
{

    if (Input.GetButton("run"))
    {

        RunningAnimation.Play();
    }
    else
    {
        RunningAnimation.Stop();
    }
}