Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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!

share|improve this question
    
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. –  Anko Jul 8 at 14:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.