Sorry to post 2 questions so soon after one another. What are the units of Rigidbody.angularVelocity? I’m hoping rpm (revolutions per minute).
Thanks again!
Sorry to post 2 questions so soon after one another. What are the units of Rigidbody.angularVelocity? I’m hoping rpm (revolutions per minute).
Thanks again!
It’s relative…depends on the mass of your object. The more mass, the more units (of whatever they are ) you need to get it to rotate.
–Eric
Crazy! Thanks!
Oh, wait…I was thinking of adding force. You’re asking about angular velocity. Oops. In that case, it’s obviously not relative to the mass, sorry. It’s not RPM though…a quick test shows that it seems to be 10x RPM. i.e., a value of 1 does 10 RPM, 4 does 40 RPM, etc.
–Eric
it’s probably radians per second.
(Math lesson: radian is the length around the circumference of a circle with a radius of 1. That means that π radians = 180 degrees, 2π = 1 revolution. This jives with being roughly 10x the RPM equivalent (in fact it’d be 60 / 6.28 times RPM) and most of the under-the-surface math in Unity is measured in radians (such as the Mathf trig functions)
I have a problem when setting rigidbody.angularVelocity = Vector3.one*10;
EDIT- found the solution, the default limit is 7, have to change it with: Rigidbody.maxAngularVelocity
AngularVelocity is vector 3, and it’s length equals speed, so if you have angular drag, the object slowly spins slower after a knock, the 3 values of the Vector3 will stay balanced and will all 3 reduce proportionally.
Here is a test:
it takes 26 fixed frames for rigidbody to rotate 180, default fixed update is 30 so it’s spinning once every 1.73 seconds, 35 revs per minute . the length of the Vector 3 is about 6.5 units. if i take away angular drag on object i could know the precise number as angular velocity would not decrease over time as it is in the list
EDIT_ sorry maybe i was talking nonsense, when angularVelocity (-100.0, 0.0, 0.0) it takes exactly 9 fixedupdate frames to go 360 degrees, to 1-2 percent precision.
Ok, I tested it out - unity measures angular velocity in radians per second.
If you don’t know what radians are, they’re a unit for measuring angles. There are 2*PI radians in 360 degrees. If you want to convert radians per second to rpm, multiply by 30/PI, and to convert the other way multiply by PI/30.
Unity doc writers, please, may you add this info in the docs?.
They don’t reliably read the forums, but you can report a documentation page in the bug reporter.