Infinite Jumping

Hello, I’m making a simple game, but the problem I have is that there is an option for infinite jumping, which I would like to cancel, I tried several options that I found on the Internet, but every time they made me unable to jump. I have all platforms set to Ground

code:
{
private Rigidbody2D rb;

[SerializeField] private AudioSource jumpSoundEffect;

private void Start()
{
    rb = GetComponent<Rigidbody2D>();
}

private void Update()
{
    float dirX = Input.GetAxisRaw("Horizontal");
    rb.velocity = new Vector2(dirX * 7f, rb.velocity.y);

    if (Input.GetButtonDown("Jump"))
    {
        jumpSoundEffect.Play();
        rb.velocity = new Vector2(rb.velocity.x, 14f);
    } 
}

}

You say you’ve got all your platforms set to “ground” but I’m not seeing any code that cares whether that’s a thing.

You’ll need a collider on the base of your player object, when the player presses jump, check if that collider is detecting collision with a “ground” object, and only jump if it is.

If you want double jumps, have a number that resets to your desired number of air jumps whenever the jump button is pressed and the player is grounded, and if the next jump press is in mid air, take 1 off that number and jump until that number is 0

oh thank, you i forgot about that