Hi, sorry for the confusing title.
What I’m trying to do is:
I have a camera, and I create a script to move the main camera using WASD keys.
var movement = Vector3.zero;
var speed = 30.0f;
if (Input.GetKey("w"))
movement.z++;
if (Input.GetKey("s"))
movement.z--;
if (Input.GetKey("a"))
movement.x--;
if (Input.GetKey("d"))
movement.x++;
transform.Translate(movement * speed * Time.deltaTime, Space.Self);
The problem is that the camera has its rotation angle x set to 36, then when I move the movement.z + + (Keyboard: W) camera instead of going forward, it drops using rotation 36, I wanted to know how to put forward in the horizontal direction, preserving the rotation x.
Like this:
Thanks.