title: Proper way to move Rigidbody GameObject
body: <p>I just started learning Unity. I tried to make a simple box move by using this script. The premise is, whenever someone presses 'w' the box moves forward.</p>
  
  <pre><code>public class PlayerMover : MonoBehaviour {
  
  public float speed;
  private Rigidbody rb;
  
  
  public void Start () {
      rb = GetComponent&lt;Rigidbody&gt;();
  }
  
  public void Update () {
      bool w = Input.GetButton("w");
  
      if (w) {
          Vector3 move = new Vector3(0, 0, 1) * speed;
          rb.MovePosition(move);
          Debug.Log("Moved using w key");
  
      }
  
  }
  }
  </code></pre>
  
  <p>Whenever I use this, the box doesn't move forward on a 'w' keypress. What is wrong with my code? I thought it might be the way I have my <em>Vector 3 <code>move</code></em> set up so I tried replacing the z-axis with speed, but that didn't work. Could someone tell me where I am messing up?</p>