Unity crashes when I add a script!

I made a simple animation script that when you press a button an animation plays. When I apply it to any object, and play the game, unity crashes!! If I delete the script then everything works fine.

The script goes like this.

if(Input.GetKey(“w”){
animation.Play(“Run”);
}
else{
animation.Stop();
}

This is becuase you are running an animtion once per frame, do:

if(Input.GetKeyDown("w")){ animation.Play("Run"); }