title: Increasing movement speed
body: <p>Is it possible to increase the movement speed by the distance/time I walked? At this moment I'm only able to set the speed to a fixed value.</p>
  
  <pre><code>void Start () {
      rb = GetComponent&lt;Rigidbody2D&gt;();   
  }
  
  void Update () {
      rb.velocity = new Vector2(3, rb.velocity.y);
  
      if (Input.GetMouseButtonDown(0) &amp;&amp; onGround)
      {
          rb.velocity = new Vector2(rb.velocity.x, 3);
      }
  }
  </code></pre>