1
\$\begingroup\$

This question already has an answer here:

I try to add angular velocity to my GameObject with this command:

rigidbody2D.angularVelocity = Random.value * tumble;

All works, but I want center of velocity be in the center of my rigidbody, but center is outside my GameObject and looks like every time in different place. How can I set rotation center to the center of my rigidbody?

IMPORTANT: when my GameObject is stay on place (no movement) then all works fine, when I add linear movement it begin rotate around some outside center.

Thanks!

\$\endgroup\$

marked as duplicate by Anko, bummzack, Sean Middleditch, MrCranky, congusbongus Jul 31 '14 at 2:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ This seems likely a Transformation matrix multiplication order issue. If you apply the rotation first, then the translation, then the rotation should stay relative to the object's origin. \$\endgroup\$ – Anko Jul 8 '14 at 14:49

Browse other questions tagged or ask your own question.