title: moving a rigidbody left and right
body: <p>I can't seem to get my rigidbody to move left and right. The code looks fine and very similar to what everyone else has posted!</p>
  
  <p>The debug statement is getting called but my character is not moving left and right.</p>
  
  <p>Thanks for the help.</p>
  
  <pre><code>public float speed = 4.0f;
   void Update()
      {
          float moveDirection = Input.GetAxis("Horizontal");
  
          if (Input.GetKeyDown("d"))
          {
              Debug.Log("pressed d");
              rb.AddForce(new Vector2(Time.deltaTime * speed * moveDirection, 0), ForceMode2D.Force);
          }
  </code></pre>