Angular Velocity not correctly rotating objects
I can't seem to get angular velocity to work properly. I've tried creating a separate project and creating an extremely simple simulation to test it. I have a single game object with a Rigidbody and a box collider. The Rigidbody has no gravity and is suspended in the air. The angular drag is also set to 0, but i have tried other values.
There is a simple script attached to the object that at the start of the game set's its angular velocity to (1, 0, 0) and after 1 second sets the angular velocity back to (0, 0, 0).
After the second is over the object always ends up with a rotation of (58.442, 0, 0). The unity documentation says "The angular velocity vector of the rigidbody measured in radians per second" so I would image that after a single second with an angular velocity of (1, 0, 0) the rotation would be exactly (180, 0, 0) but it is always (58.442, 0, 0). Is there some other variable I should take into account here? I'm creating a VR game with some very sensitive physics and if they are barely off it is extremely noticeable by the player. can someone help? :C
you basically answered your own question. angularVelocity is in radians and you expect 100° after a second. use $$anonymous$$athf.Rad2Deg and vice versa to multiply and switch between the values.
Thanks, guys you're completely right I completely forgot that a radian equals 57.2958 degrees and that you have to multiply that by pi to get 180 degrees.
Answer by OfficialDingbat · Mar 28, 2017 at 10:37 PM
My problem was simple. I was mistaken in thinking 1 radian = 180 degrees, when actually 1π radians = 180 degrees. So all I have to do is multiply my velocity by pi to make it rotate the object 180 degrees per second.
Your answer
Follow this Question
Related Questions
i wanna set max velocity, max angular velocity to joint 0 Answers
Ball slows down too fast.. why? 1 Answer
Control accurate velocity and angular velocity 0 Answers
Adding Gravity to a game object to make a black hole sucking effect. 1 Answer
Move and rotate rigid body using 6DOF marker location from file 0 Answers