캐릭터가 점프한후 공중에서 점프키 한번 더누르면 대쉬가 나가게 하고싶어서

if (isGrounded)

        {

            jumpDash = true;

        }


        if (Input.GetButtonDown("Jump"))

        {

            if (isGrounded)

            {

                theRB.velocity = new Vector2(theRB.velocity.x, jumpForce);

            }

            else

            {

                if (jumpDash)

                {

                    dashCounter = dashTime;


                    if (!theSR.flipX)

                    {

                        theRB.velocity = transform.right * dashSpeed;

                    }

                    else

                    {

                        theRB.velocity = -transform.right * dashSpeed;

                    }


                    dashCounter -= Time.deltaTime;


                    if (dashCounter <= 0)

                    {

                        jumpDash = false;

                    }

                }

            }

        }

대충 이런식으로 코드를 짰는데 점프한 후 점프버튼을 눌러도 대쉬가 씹힐때가 있는데 어디가 잘못된걸까