Animations Not Playing

var walk : AnimationClip;

function Start () {
animation.playAutomatically = false;
}

function Update () {
if(Input.GetAxis("w")){
animation.Play(walk);
}
}

This doesnt work, and I’m sure it’s VERY wrong. I’m sure someone could point me in the right direction.

Should it not be Input.GetButton(“w”) ? input.GetAxis returns a float not a bool