- Home /
Problem with transform.Rotate
Hi everybody, im trying to meve an object. ill be more specific. i have a sphere that turns around while i press the fire button and drag the mouse around the screen, everithing works perfectly but after a wile when my sphere is fully rotated, the axis are changed so when i try to rotate on y axis the rotation goes wrong, at least not as i spect. im using
mundo.transform.Rotate(Vector3(Input.GetAxis("Mouse Y")(0.5), Input.GetAxis("Mouse X")(-0.5), 0), Space.Self);
I would like to keep the axis in the rigth position or at leas keep my rotation straigh i mean, when i drag the mouse left to rigth the sphere rotating on y and up to down, on X. and yes, sorry, english its not my native language.
your using sphere... so when you move the object its actually rotating[if you havent frozen the rotation]... so after a while the rotation of your sphere wont be pointing to the exact plane when in begining.....
Answer by Anusha · Sep 05, 2012 at 05:56 AM
Use AddForce() instead.... it will give you the required output by not messing with your rotational axises...
so i can add some force and then just make that force equal to "0" and the object will stop?
thanks a lot!
and, sorry, how can i add some rotational force ins$$anonymous$$d direction. because when i add some force to an object it moves from its position, and i just want it to rotate.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Frreze Rotation and poSITION PROBLEM HELP!! 2 Answers
How to lock the Z axis so my Enemy just flips on the Y axis 1 Answer
UnityException: Input Axis Rotate is not setup. 2 Answers
Cloth problem 2 Answers