Hello, for some reason when I move horizontally while Im climbing my player slightly falls down vertically. When i tried to fix it, i was able to walk infinitely horizontally. So how should i change my code so i have neither of these problems?

    private void Update()

        if (IsClimbable)
        {
            float verticalInput = Input.GetAxisRaw("Vertical");
            float horizontalInput = Input.GetAxisRaw("Horizontal");

            if (verticalInput > 0)
            {
                if (Input.GetKey(KeyCode.LeftShift))
                {
                    Player.velocity = new Vector2(Player.velocity.x, climbSprint);
                }
                else
                {
                    Player.velocity = new Vector2(Player.velocity.x, climb);   
                }
                IsClimbing = true;
            }
            else if (verticalInput < 0)
            {
                Player.velocity = new Vector2 (Player.velocity.x, -climb);
                IsClimbing = true;
            }
            else
            {
                Player.velocity = new Vector2 (0f, 0f);
                IsClimbing = true;
            }

            if (IsClimbing && IsClimbable && verticalInput == 0f && horizontalInput == 0f)
            {
                Player.velocity = new Vector2 (Player.velocity.x, 0f);
                Physics2D.gravity = new Vector2 (Player.velocity.x, 0f);
            }
            else if (IsClimbing || IsClimbable || (verticalInput !=0f) || (horizontalInput !=0f))
            {
                Physics2D.gravity = new Vector2 (0, -9.81f);
            }
        }