- Home /
Object doesn't rotate around it's pivot point on collision
Hello, everyone! Right now I got a cylinder without a rigidbody and without a collider, and it's parent is an empty game object with a rigidbody (x,y,z position and y,z rotation are frozen) and a collider. It's pivot point is slightly above the cylinder.
Screenshot: https://www.dropbox.com/s/7pu171jufjs2q9o/Screenshot%202014-01-10%2010.09.12.png
I want it to rotate around it's pivot point (around the x axis). When I do it with a script it works fine, but on collision the game object rotates around center. How do I fix it?
Answer by Mikea15 · Jan 10, 2014 at 01:57 PM
Is the Pivot point a parent of the gameobject detecting the collision? If so, you should set the rotation to the parent of the gameobject that detected the collision. ( in this case, the pivot point ).
Thanks, I guess I've already solved the problem. Just had to add Hinge Joint to the cylinder and ins$$anonymous$$d of putting a collider onto the parent object, put it onto the cylinder.