what's wrong in this basic keyboard input?

what exactly is wrong in this basic keyboard input command?

void Update () { if(Input.GetKeyDown(KeyCode.LeftArrow))
translate.Transform(-1,0,0);

Your code is working, it is just not doing what you want (I guess), considering you are missing a } at the end.

Use

if(Input.GetKey(KeyCode.LeftArrow))transform.Translate(-1,0,0);

Another way to do this is:

float _x = Input.GetAxis("Horizontal") * Time.deltaTime;
float _y = Input.GetAxis("Vertical") * Time.deltaTime;
transform.Translate(_x,_y,0);

void Update()
{
if(Input.GetKeyDown(KeyCode.LeftArrow))
{
gameObject.transform.Translate(-1, 0, 0);
}
}

For whatever reason if that code tw1st3d posted is not working then you should try editing the input options in the editor under edit->project settings->input and add or change one of the inputs names to “leftArrow” and change possitive button to LeftArrow.

Then your code would look like this:

void Update()
{
  if(Input.GetKeyDown("leftArrow"))
  {
    gameObject.transform.Translate(-1, 0, 0);
  }
}