I was attempting (more like miserably failing) to utilize Torque and/or AngularVelocity to rotate a 2D sprite with a circle collider. I went through a LOT of articles and the methods I found just didn’t work for me. Only way I found was using transform, but it’s buggy and complex.
Cheers!
What did you try exactly?
All you should need to do is either assign a value to .angularVelocity
, or call AddTorque
… and that’s it really.
As above, if you simply set the angular velocity on a Rigidbody2D then it’d rotate. This is no different than setting the linear velocity to get it to translate.
If it’s not moving then you must be stomping over the Transform somewhere overriding the Rigidbody2D writing to the Transform.
As always, spin up a new project, add a Rigidbody2D and set its angular velocity. It’ll rotate and fall due to gravity (unless you set its gravityScale to zero).
1 Like