I need help with movement script

Heres my script and from what I know about scripting it should work

function Update() {
     if (Input.GetButtonDown ("W")) {
     (transform.Translate(1, 0, 0));
     }
}

but it dosnt i was gonna add on to it and make it so the mouse look would drive it and i could hit the “W” button to move forward so i could fly (I have yet to achieve flight)

can someone please help me in what i am doing wrong it lets me play but when i hit “W” nothing happens

i did what you told me nothing happend

Input.GetKeyDown(“w”) or Input.GetButtonDown(“Forward”)