Jumping problems

I’ve just started Unity and have been following the live training videos, however the double jump they used doesn’t seem to be working 100% of the time in my game.

Every now and again I press the space twice and nothing will happen the second time around, is there something wrong with my code?

    public float speed = 6f;

    //jump
    bool grounded = false;
    public Transform groundCheck;
    float groundRadius = 0.2f;
    public LayerMask WhatIsGround;
    public float jumpForce = 700f;
    bool doubleJump = false;


   
    // Update is called once per frame
    void FixedUpdate ()
    {
        //moving horizontal
        //float move = Input.GetAxis ("Horizontal");
        rigidbody2D.velocity = new Vector2 (1 * speed, rigidbody2D.velocity.y);

        //Jumping
        grounded = Physics2D.OverlapCircle (groundCheck.position, groundRadius, WhatIsGround);    //checks to see if player is on the ground

        if (grounded)
                doubleJump = false;


    }
    void Update()
    {
        if ((grounded || !doubleJump) && Input.GetButtonDown("Jump"))
        {
            rigidbody2D.velocity = new Vector2(rigidbody2D.velocity.x, 0);
            rigidbody2D.AddForce(new Vector2(0f,jumpForce));

            if (!doubleJump && !grounded)
                doubleJump = true;
        }
    }
}

i think u are updating the doblejump bool to true in the first jump on Update method

if (!doubleJump && !grounded)
                doubleJump = true;

this if is true in the first jump because doubleJump is false but with the not give true and grounded is false too but with the not give true too, this update dobleJump to true and when u are in the middle of the jump the first grounded is false and !doubleJump is false too and cant make the doble jump.

to solve tray to change the if ((grounded || !doubleJump) && Input.GetButtonDown("Jump")) to if ((grounded || doubleJump) && Input.GetButtonDown("Jump"))
in the first jump you active the second jump and when u push jump the bool allow u to make it. (but maybe to the infinty)

good luck