Currently, in Unity, I have my MainCamera rotated at an angle to the ground. If I use the Translate() method on the camera’s transform object, it moves in local space meaning if I move it in the Z-axis, it moves closer or farther away to the ground at an angle.
What I wanted, was to move parallel to the ground on the Z-axis when using the W & S keys, and move in the X-axis when using the A & D keys even though my camera is rotated. I knew Global space would allow me to do that but I couldn’t easily find how to affect the transform global space instead of in local space. After some Googling & tinkering, I bore the fruit of my labors with this script attached to my MainCamera (ignore the TODO & NOTE).
I have a custom input defined in Project Settings -> Inputs called “CameraHeight” that is mapped to the Q & E keys. That moves the camera straight up in the Y-axis. It seems that modifying the transform.position value affects the Global space coordinates. Using the Translate() method affects the camera’s transform in local space.
Thought this might be helpful to someone else, I had a hard time finding the answer in my search.