An Input.GetKeyDown always returns false

I’m trying to prevent the player to start sprinting while in air, to accomplish this I need to get when I start to press the left shift, but the GetKeyDown for “justSprinted” always returns false (everything else works as intended), so the “airSprintCheck” (that prevent the player to sprint) never goes true.
As you can see everything seems ok.
I also tried in the Update function but nothing changed.

float hMove = Input.GetAxisRaw("Horizontal");       //move
        float vMove = Input.GetAxisRaw("Vertical");
        bool jump = Input.GetKeyDown(KeyCode.Space);        //jump
        bool isGrounded = Physics.Raycast(groundDetector.position, Vector3.down, 0.1f, ground);
        bool isJumping = jump && isGrounded;
        bool sprint = Input.GetKey(KeyCode.LeftShift);      //sprint
        bool justSprinted = Input.GetKeyDown(KeyCode.LeftShift);
        bool isSprinting = sprint && vMove > 0;
        bool slide = Input.GetKey(KeyCode.LeftControl);     //slide
        bool isSliding = isSprinting && slide && !sliding;
        if (justSprinted && !isGrounded)
        {
            airSprintCheck = true;
        }
        else if (isGrounded)
        {
            airSprintCheck = false;
        }
        Vector3 direction = Vector3.zero;
        float trueSpeed = speed;
        if (!sliding)
        {
            direction = new Vector3(hMove, 0, vMove).normalized;
            direction = transform.TransformDirection(direction);
            if (isSprinting && !airSprintCheck)
            {
                if (crouched)
                    SetCrouch(false);
                trueSpeed *= sprintModifier;

            }
            else if (crouched)
            {
                trueSpeed *= crouchModifier;
            }

        }

Are you sure that you are not changing airSprintCheck in another place and that isGrounded is working as expected? justSprinted should become true in the first frame that you press the left shift key, try to spam some prints over code to see, if you can try a debugger it will show to you variable step by step.

Last but not least, use code tag instead of screenshots, this will we can copy/paste you code to test in our environment

I debugged and really I don’t understand why justSprinted remains false when I press the key in game, everithing else is correct.

Yeah sorry for the screenshot, I will edit the post

If you’re doing this to learn how to write a controller, disregard the following:

If you would prefer something more full-featured here is a super-basic starter prototype FPS based on Character Controller (BasicFPCC):

https://discussions.unity.com/t/855344

That one has run, walk, jump, slide, crouch… it’s crazy-nutty!!