title: Why is my game object going up when "jump" button is only pressed once (when gravity in rigidbody is turned off) in Unity?
body: <p>So I was trying to add jump button to my player in Unity and I was successful with it
  But while test running the game, everything was fine until I switched off the gravity
  I pressed the jump button once, and the player kept going up at const speed. I solved the problem by turning on the gravity again.</p>
  <p>I just wanna know why did that happen?</p>
  <p>This is my part of the &quot;jump code&quot; for reference:-</p>
  <pre><code>void Update()
      {
          if (Input.GetKeyDown(KeyCode.Space))
          {
              rb.velocity = new Vector3(0,3,0); //rb : rigidbody object
              print(&quot;Jumped&quot;);
          }
      }
  </code></pre>