title: Continue moving in the same direction as the last input
body: <p>I am working on my spaceship game. I have done a lot of things in it but now I am facing a problem. The controls of the game are made by <code>Input.GetAxis</code>.</p>
  
  <p>What I want to do now is that once I take the thinger of the W key, for the player to continue move in the same direction or from others keys. I want the player to continue moving in the same direction as the last input and if the gamer will want to change its direction he will need to click on another button, and <em>then</em> it will start moving in another direction. I tried it by myself but I didn't succeed.</p>
  
  <pre><code>public float Force;
  public Rigidbody rb;
  public float speed;
  public Done_Boundary boundary;
  public float RotSpeed;
  public GameObject shot;
  public Transform shotSpawn;
  public float fireRate;
  private float nextFire;
  /*public Text bullettext;
  public int maxbullet = 35;
  public int curbullet = 0;
  public GameObject NoBulletP;
  public bool bulletgiving = false;
  public void OK()
  {
      NoBulletP.SetActive (false);
  }*/
  void Start()
  {
      //curbullet = maxbullet;
      rb = GetComponent&lt;Rigidbody&gt; ();
  
  }
  void Update ()
  {
      //bullettext.text = "Bullets: " + curbullet;
      if (Input.GetButton ("Fire1") &amp;&amp; Time.time &gt; nextFire)
      {
              /*if (curbullet == 0) 
              {
                  NoBulletP.SetActive (true);
                 if(!bulletgiving)
                {
                    StartCoroutine (wait());
                }
              }
              else if(curbullet &gt; 0)
              {
              curbullet--;*/
              Instantiate (shot, shotSpawn.position, shotSpawn.rotation);
              nextFire = Time.time + fireRate;
              GetComponent&lt;AudioSource&gt; ().Play ();
              /*}
             else if(curbullet &lt; 0)
             {
              curbullet = 0;
             }*/
      } 
  }
  void FixedUpdate ()
  {
      float moveHorizontal = Input.GetAxis ("Horizontal");
      float moveVertical = Input.GetAxis ("Vertical");
      rb.velocity = transform.forward * moveVertical * speed;
      transform.Rotate (0.0f,moveHorizontal * RotSpeed * Time.deltaTime,0.0f);
      rb.position = new Vector3(Mathf.Clamp (rb.position.x, boundary.xMin, boundary.xMax), 0.0f, Mathf.Clamp (rb.position.z, boundary.zMin, boundary.zMax));
  }
  </code></pre>