Changing a variable after pressing a button for a constant change.

I am having trouble trying to figure out how to change this value. I just want to change the value “dashTime” after I press the space bar. But it seems to only incrementally change after I press the space bar. I can’t understand how to change it so that the value will continue to change even after I have pressed the button.

if(!isGrounded() && Input.GetKeyDown(KeyCode.Space))
        {
            playerRigid.gravityScale = 0;
            dashTime += Time.deltaTime;
            if (facing_Right && dashTime<.5f)
            {
                playerRigid.velocity = new Vector2(playerRigid.velocity.x + speed * 3, 0);
            }else if (!facing_Right && dashTime<.5f)
            {
                playerRigid.velocity = new Vector2(playerRigid.velocity.x - speed * 3, 0);
            }

            
        }
        
        if (dashTime >= .5f)
        {
            playerRigid.gravityScale = 5;
            dashTime = 0;
        }

I’m not quite sure I understood your question, but i’d say what you’re looking for is Input.GetKey instead of Input.GetKeyDown

GetKey will return true while the key is being pressed (everyframe it is pressed), meanwhile, GetKeyDown will only return true the exact frame the key is pressed.