!st person object only moving in global coordinates

So I’ve been making a 1st person controller in unity. I want to make the player move in relation to where I am looking at (basically, on the local coordinates), however, when I run it, it keeps moving at the same direction(the global coordinates). Can somebody give me some help on the matter?

here’s the code:

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

public class moveAround : MonoBehaviour
{
public CharacterController controller;
public float speed = 10;

void Update()
{
float Xinput = Input.GetAxis("Horizontal");
float Zinput = Input.GetAxis("Vertical"); 

Vector3 move = transform.right * Xinput + transform.forward * Zinput;
controller.Move(move * speed * Time.deltaTime); 
}
}

See the line where you construct your move vector?

Those transform.right / transform.forward shortcuts refer to where this script is.

Instead, use the controller reference instead, as in controller.transform.right.

Also, if you would prefer something more full-featured here is a super-basic starter prototype FPS based on Character Controller (BasicFPCC):

That one has run, walk, jump, slide, crouch… it’s crazy-nutty!!

i may be wrong, but i think local means in relation to the parent object and global is the scene.
if that is the case you want to be moving on the global anyways.

your controller.transform.right idea didn’t help, but I found that, if I made an object with my look around code (only horizontal portion) and then referenced it in the moving code, it actually worked, so thanks a bunch friend!