Walking forward

I know alot of questions about this already, but not like a I want.
I want my character to move only forward and rotate left and right.

I have the script to rotate

function Update () 
{
     if(Input.GetKey(KeyCode.LeftArrow))
          {
               transform.Rotate(0f,-5f,0f);
          }


      if(Input.GetKey(KeyCode.RightArrow))
          {
               transform.Rotate(0f,5f,0f);
          }
}

Very simple script.
I don’t know if possible to do something like that to walk forward.

if(Input.GetKey(KeyCode.UpArrow))
     {

     }

Thanks for the help :slight_smile:

You need to look into using Time.deltaTime as part of your movement scripts. It helps keep movement smooth.

Moving forward would just be a case of using transform.Translate(…);

Hope this helps.

Transform.Translate() should work properly here