Rotate multiple axes
Hello, I'm currently trying to do a space sim game, but i have a problem with the rotation. I rotate in the X and Y axis (up/down and left/right) using the mouse with this:
rotLeftRight = Input.GetAxis("Mouse X") * mouseSensitivity;
rotUpDown = Input.GetAxis("Mouse Y") * mouseSensitivity;
transform.Rotate(0, rotLeftRight, 0, Space.World);
transform.Rotate(-rotUpDown, 0, 0, Space.Self);
This way the rotation in the X and Y axis is independent from each other. But when I try to rotate in the Z axis with the Q/E keys it's not. Pressing the keys will also rotate in the X and Y axis.
Do you know if it's posible to rotate in 3 axes independently? Thanks!
Your answer
Follow this Question
Related Questions
Need help with balance rotation mechanic on 3D soldier 0 Answers
How to rotate an object according to the camera's view? 1 Answer
how to reset back the rotation 0 Answers
Rotating Camera around Player's X-axis while rotating Player around its Y-axis (using mouse input) 0 Answers
Rotate object in 3d space along one axis in the direction of movement vector. 0 Answers