2D Infinite jump fix?

using System.IO.Compression;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
    [Header("Movement Settings")]
    public float walkSpeed = 8f;
    public float airControl = 0.5f;
    public float acceleration = 10f;
    public float deceleration = 15f;

    [Header("Jump Settings")]
    public float jumpForce = 15f;
    public float maxJumpTime = 0.3f;
    public float coyoteTime = 0.15f;
    public float jumpBufferTime = 0.15f;
    
    
    public enum Form { Solid, Liquid, Gas }
    [Header("Form States")]
    public Form currentForm = Form.Solid;
    
    private Rigidbody2D rb;
    private bool isGrounded;
    private bool isJumping;
    private float jumpTimeCounter;
    private float coyoteTimeCounter;
    private float jumpBufferCounter;
    private float moveInput;
    
    [Header("Checks")]
    public Transform groundCheck;
    public LayerMask groundLayer;
    public float groundCheckRadius = 0.2f;

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

    private void Update()
    {
        HandleInput();
        HandleJump();
        HandleFormSwitch();
    }

    private void FixedUpdate()
    {
        CheckGround();
        MovePlayer();
    }

    void HandleInput()
    {
        moveInput = Input.GetAxisRaw("Horizontal");
        
        // Apply jump buffering
        if (Input.GetButtonDown("Jump"))
        {
            jumpBufferCounter = jumpBufferTime;
        }
        else
        {
            jumpBufferCounter -= Time.deltaTime;
        }
    }

    void HandleJump()
    {
        if (isGrounded)
        {
            coyoteTimeCounter = coyoteTime;
        }
        else
        {
            coyoteTimeCounter -= Time.deltaTime;
        }

        if ((jumpBufferCounter > 0) && (coyoteTimeCounter > 0))
        {
            isJumping = true;
            jumpTimeCounter = maxJumpTime;
            rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpForce);
            jumpBufferCounter = 0;
        }

        if (Input.GetButton("Jump") && isJumping)
        {
            if (jumpTimeCounter > 0)
            {
                rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpForce);
                jumpTimeCounter -= Time.deltaTime;
                isGrounded = false;
            }
            else
            {
                isJumping = false;
            }
        }

        if (Input.GetButtonUp("Jump"))
        {
            isJumping = false;
        }
    }

    void MovePlayer()
    {
        float targetSpeed = moveInput * walkSpeed;
        float speedDif = targetSpeed - rb.linearVelocity.x;
        float accelRate = (isGrounded) ? acceleration : acceleration * airControl;

        float movement = Mathf.MoveTowards(rb.linearVelocity.x, targetSpeed, accelRate * Time.fixedDeltaTime);
        rb.linearVelocity = new Vector2(movement, rb.linearVelocity.y);
    }

    void CheckGround()
    {
        isGrounded = Physics2D.OverlapCircle(groundCheck.position, groundCheckRadius, groundLayer);
    }

    void HandleFormSwitch()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1)) SwitchForm(Form.Solid);
        if (Input.GetKeyDown(KeyCode.Alpha2)) SwitchForm(Form.Liquid);
        if (Input.GetKeyDown(KeyCode.Alpha3)) SwitchForm(Form.Gas);
    }

    void SwitchForm(Form newForm)
    {
        currentForm = newForm;
        switch (newForm)
        {
            case Form.Solid:
                walkSpeed = 6f;
                jumpForce = 12f;
                rb.gravityScale = 2f;
                print("Solid");
                break;
            case Form.Liquid:
                walkSpeed = 5f;
                jumpForce = 8f;
                rb.gravityScale = 1f;
                print("Liquid");
                break;
            case Form.Gas:
                walkSpeed = 4f;
                jumpForce = 4f;
                rb.gravityScale = 0.5f;
                print("Gas");
                break;
        }
    }

    private void OnDrawGizmos()
    {
        Gizmos.color = Color.red;
        Gizmos.DrawWireSphere(groundCheck.position, groundCheckRadius);
    }
}

This is my code rn, I’ve been trying to fix infinite jump for the past hour, please help me

Are you trying to learn how to make a character controller or do you just want one?

If you’re trying to learn, now is the time for you to learn how to debug what you have. Otherwise what’s the point?

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

Remember with Unity the code is only a tiny fraction of the problem space. Everything asset- and scene- wise must also be set up correctly to match the associated code and its assumptions.

If you just need to start with a jump buffer / coyote time example, here’s mine:

Coyote Time Jumping and disconnecting input gathering from input processing: