Rotate grabbed object in relation to cameras Axis
What I'm trying to achieve is to have a object that is grabbed to be able to rotate in relation to the mouse input. Now I've basically got it working but this only works when your in a leveled area. My game is based on spherical worlds so when the player is upside down the rotation doesn't work properly.
What I don't understand how to do is try and make the object when its being rotated to have the same axis of the camera so if the camera is upside down or not, moving the mouse left to right will turn the object left to right and up and down will rotate it up and down.
Heres the code I have and after checking out out again its moving the object but its not rotating the object the right way. objectGrabbed.transform.Rotate (new Vector3 (Input.GetAxis ("Mouse Y"), Input.GetAxis ("Mouse X"), 0) * Time.deltaTime * grabbedRotSpeed);
So in short i want the object to have the same XYZ axis to the players camera, i think...
Your answer
Follow this Question
Related Questions
How can I rotate a sphere so the point is centered in front of the camera 1 Answer
have one object rotate another object on the y axis 0 Answers
How come when I rotate my spaceship, it also rotates on the two other axis's? Please help? 0 Answers
Character rotation for Y equal to the camera 0 Answers
if a camera rotates to a point, make something else move? 0 Answers