How to disallow double jumping.

I need to restrict the player’s ability to double jump. Right now I have jump height restricted by a timer, I need that timer to set itself to one, or the Jumping() function to turn itself off, if the key is released while the player is in the air.
if (Input.GetKey(KeyCode.X) || Input.GetKey(KeyCode.L))
{

        if (moveHorizontal != 0)
        {
            timer += Time.deltaTime;
            if (timer < jumpTime && isGrounded == true)
            {
                Jumping();
            }

        }
    }
void Jumping()
    {
        objPlayer.AddForce(Vector3.up * jumpHeight);
    }

void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "Tile")
        {
            timer = 0f;
            isGrounded = true;
        }
    }

Try adding isGrounded = false; after the line objPlayer.AddForce(Vector3.up * jumpHeight);
right now your code doesn’t seem to be using is grounded.

As rolling said I don’t see anywhere that the player’s “isGrounded = false”. You would need either
OnCollisionExit2D, or depending on how complex your system is you might just want to line/ray cast to a marker that goes below ground. That way it’s being check constantly. At the very least you’d want something along the lines of;

void Jumping()
     {
         objPlayer.AddForce(Vector3.up * jumpHeight);
         isGrounded = false;
     }

OR

If you’re creating a game based on tiles, mark them as Ground in the layer mask and use

isGrounded = Physics.Linecast(transform.position, Grounding.transform.position, 1 << LayerMask.NameToLayer("Ground"));