Slide in one set direction

I have a movement script with a slide script in it on a character controller, the script works off of a timer and works great except for the fact you can move the direction of the slide to whatever your mouse is pointed at. I would appreciate help in making it so that the direction of the slide is the direction it continues at until it’s done. I also condensed this so you no one would have to look through 300 lines of code so if I’m missing something, let me know.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
    public float slideSpeed = 7f;
    public float slideTimer = 1.2f;

    float x = 0f;
    float z = 0f;

    static bool isSliding = false;
    static bool canSlide = false;
    bool isGrounded;
    Vector3 velocity;

    void Update()
//Basic movement-------------------------------------------------------------------
        isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask);

        if (isGrounded && velocity.y < 0 && !isSliding)
            x = Input.GetAxis("Horizontal");
            z = Input.GetAxis("Vertical");

            if (velocity.y < 0)
                velocity.y = -2f;

            Vector3 move = transform.right * x + transform.forward * z;

            controller.Move(move * baseSpeed * Time.deltaTime);

        if (Input.GetKeyDown(KeyCode.F) && canSlide && isGrounded)

        void Slide()
            playerCol.height = crouchHeight;
            baseSpeed = slideSpeed;
            isSliding = true;
            canSprint = false;
            isSprinting = false;
            isProne = false;
            canJump = false;
            isCrouched = false;
            canSlide = false;
            slideTimer += Time.deltaTime;

        IEnumerator SlideTimer()
            yield return new WaitForSeconds(slideTimer);
            if (isSliding)

The script doesn’t update x and y if the character isSliding is true.
So, the only reason why the direction is getting changed is the transform.rightand transform.forward are changed somewhere. Most likely you turn the character’s transform to the mouse position, and Vector3 move = transform.right * x + transform.forward * z; is turning accordingly.