unity navigation please help

hi,
i am trying to edit the animation so when the user click’s the ‘fire1’ button it move the chracter controller in the direction the mouse is pointing. i have got the user to move when they press the mouse button but it will only go in one direction. Here my script if you can help thank you:

else if(Input.GetButton(“Fire1”))
{

CharacterController controller = GetComponent();
moveDirection = new Vector3(-5, 0, 0);
controller.Move(Vector3.forward * Time.deltaTime);
rotationX += Input.GetAxis(“Mouse X”) * sensitivityX;
rotationX = ClampAngle (rotationX, minimumX, maximumX);
Quaternion xQuaternion = Quaternion.AngleAxis (rotationX,Vector3.up);
transform.localRotation = originalRotation * xQuaternion;
}

The movement vector for CharacterController.Move is in world coordinates, so if you use a vector like Vector3.forward, it will move along the global Z axis. You need to convert the local direction to world coordinates using transform.TransformDirection. (There’s also a shortcut for this common case - you can use transform.forward):-

controller.Move(transform.forward * Time.deltaTime);

that makes sense thank you for your help