Double Jump

Hello guys, I know alot of people asked to this, and I know there are alot of tutorials…but I really don’t know how to came out.

So, I followed a tutorial, and now my character is moving and jumping; but what about if I want him to double jump? What can I do in this case? Here the code I’m using

      //ANIMATIONS
                //PLAYER DIRECTION
                if (moveX < 0.0f && facingRight == false)
                {
                    FlipPlayer();
                }
                else if (moveX > 0.0f && facingRight == true)
                {
                    FlipPlayer();
        
                }
                //PHYSICS
                gameObject.GetComponent<Rigidbody2D>().velocity = new Vector2(moveX * playerSpeed, gameObject.GetComponent<Rigidbody2D>().velocity.y);
        
            }
        
            void Jump()
            {
        
                //JUMPING CODE
                GetComponent<Rigidbody2D>().AddForce (Vector2.up * playerJumpPower);

Thank you all for the help!

Hi @tokyotora26 - This question has already been asked answered - just google it:

What I did was:

add a jump counter.

And if player wasn’t grounded and jumpCount is less than 1,

then call jump again

and jumpCount++.

Pretty simple once I figured it out. Try that and see what ya get. Hopefully I explained it clearly!