Hi, I have a camera which moves left right up and down using mouse getAxis.
I get the the mouse axis values and add them to a variable called movementOffset. The camera moves fine when it has no rotation, but when i rotate it, the camera moves in weird directions rather than left right up and down. How can I translate the movementOffset in such a way that the camera always moves left right up and down no matter what the rotation is.
How I move:
movementOffset += new Vector3(Input.GetAxis("Mouse X"), 0, Input.GetAxis("Mouse Y"));
transform.position += movementOffset;
Have you tried setting a parent for you camera and moving that. And rotate the camera as a child?
– BruceKristelijn@BruceKristelijn that doesn't works because I am changing the global position of the camera not local...
– ktest112233