- Home /
Question by
Hyperactive · Feb 09, 2015 at 04:05 PM ·
parentchild
Rotate children around parent pivot
Hi Coders ! :)
I'm trying to rotate a parent object, which works with
transform.rotation *= Quaternion.AngleAxis(45*Time.deltaTime, Vector3.right);
But all the children of that object rotate around their own pivot instead of rotating around the parent pivot.
Is there a line I'm missing to tell the child to rotate with the parent pivot ?
Thanks ! :)
Hyper
Comment
Take a look at the answers to this question: Rotating a child around its parent.
Basically, use either Transform.RotateAround (with the parent's position as the point and the axis and angle as before) or place the child inside an empty child object that shares the pivot location of the parent and rotate the empty object.