My character multi jumps

So I created a panel when clicked the game will start and the controls will activate(The controls wont activate until I press the button). I created an empty, put the code inside it, put the empty inside the onclick method of the button inside the panel and selected the ControllerOpener method. But it seems to be multijumping.

How can I fix it?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class hareketbenim : MonoBehaviour
{

    public float speed = 8f;
    public float jump = 16f;
    private float horizontal;
    public bool isJumping;
    private bool panelclicked = false;  // i have a panel to start the game so it is controlling the controls depending on the panel is clicked
    public Rigidbody2D rb;

    void Update()
    {
        if (panelclicked == true)
        { 
            horizontal = -Input.GetAxis("Horizontal");
            rb.velocity = new Vector2(speed * horizontal, rb.velocity.y);
            if (Input.GetKeyDown(KeyCode.W) && isJumping == false)
            {
                rb.AddForce(new Vector2(rb.velocity.x, jump));
            }
        }
    }

    private void OnCollisionEnter2D(Collision2D other)
    {
            if (other.gameObject.CompareTag("ground"))
            {
                isJumping = false;
            }

            if (other.gameObject.CompareTag("flag"))
            {
                Destroy(other.gameObject);
            }
    }

    void OnCollisionExit2D(Collision2D other)
    {
            if (other.gameObject.CompareTag("ground"))
            {
                isJumping = true;
            }
    }

    public void ControllerOpener()
    {
        panelclicked = true; 
    }

}

Try adding in your isJumping = true inside your if statement where the RigidBody jump takes place.

I made it but now it can only jump once.

Try adding a Debug.Log("isJumping : " + isJumping); in Update.

If isJumping is not set to false when your player touches the ground then the issue comes either from OnCollisionEnter2D, or more likely from your CompareTag. Make sure that the tag is spelled exactly the same way and that it’s set to your ground object.