Please help with extrajumps

im trying to add extra jumps but even when im in the air i can jump this is my script

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

public class movement : MonoBehaviour {
  
    public float speed;
    public float jumpForce;
    private float moveInput;
    private Rigidbody2D rb;
    private bool facingRight = true;
    private bool isGrounded;
    public Transform groundCheck;
    public float checkRadius;
    public LayerMask whatIsGround;
    private int extraJumps;
    public int extraJumpsValue;



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

    void FixedUpdate() {

        isGrounded = Physics2D.OverlapCircle(groundCheck.position, checkRadius, whatIsGround);

        moveInput = Input.GetAxis("Horizontal");
        Debug.Log(moveInput);
        rb.velocity = new Vector2(moveInput * speed, rb.velocity.y);

        if (facingRight == false && moveInput > 0) {
            Flip();
        }else if (facingRight == true && moveInput < 0) {
            Flip();
        }


    }

    void Update() {

        if (isGrounded == true) {
            extraJumps = extraJumpsValue;
        }

        if (Input.GetKeyDown(KeyCode.UpArrow) && extraJumps > 0) {
            rb.velocity = Vector2.up * jumpForce;
            extraJumps --;
        } else if (Input.GetKeyDown(KeyCode.UpArrow) && extraJumps == 0 && isGrounded == true) {
            rb.velocity = Vector2.up * jumpForce;
        }
    }


    void Flip() {

        facingRight = !facingRight;
        Vector3 Scaler = transform.localScale;
        Scaler.x *= -1;
        transform.localScale = Scaler;
      
    }


}

I can imagine, it has something to do with running the check for isGrounded in FixedUpdate but using its value in Update. FixedUpdate doesn’t run a often as Update, so the value might not change fast enough. Have you tried checking for isGrounded in Update instead of FixedUpdate?

Just a wild guess, though.

Edit: From what it looks like, you might also want to change the order of your last two if statements in your Update, if I’m not mistaken.

thank you it worked