- Home /
Question by
warhammercasey · Dec 13, 2015 at 02:55 PM ·
rotationmouserotate object
Rotate based off of a mouse.
First of all, I know there are a lot of questions with this on it and I thought I knew how to do it (when I looked it up, it was saying almost the same thing as what I was doing) but none of them worked even the answered ones. My code is in the update loop:
transform.rotation = new Quaternion(transform.rotation.x, transform.rotation.y+Input.GetAxis ("Mouse Y")*10, transform.rotation.z, transform.rotation.w);
target.transform.rotation = new Quaternion(target.transform.rotation.x, target.transform.rotation.y+Input.GetAxis ("Mouse Y")*10, target.transform.rotation.z, target.transform.rotation.w);
(Im rotating two objects and target is the other one)
Comment
Your answer
Follow this Question
Related Questions
How to rotate a gameobject (Y Axis) via c#? 2 Answers
Character Not Rotating 0 Answers
How to set rotation of Car Steering Wheel According to Horizontal Axis 0 Answers
Rotate around, but track the mouse 1 Answer
Need help undersanding this code 1 Answer