title: Unity2D preventing character from multi-jumping
body: <p>My character can jump as much as you press ( W or space) I've read that you can prevent it with Raycast, but I don't understand how to do so. This is my character's code(this is a platformer game) : </p>
  
  <pre><code>private Rigidbody2D myRigidBody2D;
  void Start () {
  
      myRigidBody2D = GetComponent&lt;Rigidbody2D&gt;();
  
  }
  
  private void Update()
  {
      if (Input.GetButtonDown("Jump"))
      {
          myRigidBody2D.AddForce(new Vector2(0, jumpForce));
      }
  }
  </code></pre>