[C#]CharacterController Turning

Hello! I have a player with character controller and i set it to move forward all the time,now i want when player triggers something to change the direction to right(i know how to do the trigger part i just dont know how to do the direction part). It’s an endless runner game. Please help i can’t find any good videos for character controller turning.
Here is my code

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

public class PlayerMotor : MonoBehaviour {

    private CharacterController controller;
    private float speed = 5.0f;

	// Use this for initialization
	void Start () {
        controller = GetComponent<CharacterController>();
	}
	
	// Update is called once per frame
	void Update () {
        controller.Move(Vector3.forward * Time.deltaTime * speed);
	}
}

Vector3.forward

in

controller.Move(Vector3.forward * Time.deltaTime * speed);

line is the direction. Just change it to Vector3.right when you want and all will be good.

Example code:

private Vector3 direction = Vector3.forward;

void Update()
{	
	if (Input.GetKeyDown("space"))
		direction = Vector3.right;
	
	controller.Move(direction * Time.deltaTime * speed); 
}

This changes the direction to right when user presses space bar

Thank you so much, if i earn loads of money of this game (my fourth game) i’m giving you some. It worked thank you so much again.