Rotating two separate objects within same rotation point

Hi guys, I have one question about rotating two separating objects within same rotation point.
I have two separate gameobjects and both of them have a child object inside(one is for body and one is for accessory like cap etc, and I am doing something like sprite billboarding).
When I rotate two of the objects together, they rotate at different rotation point. How do I make them rotate at the same point without combining those two gameobjects inside a same parent object. Is there any math I need to use to calculate the rotation point?

You could temporarily parent the objects to an invisible object at the center of rotation, then rotate the invisible object, then unparent the objects.

1 Like

Hi, thank you for your reply. It looks like a good solution but sorry for me being a little bit stubborn here, is there anyway to do this without create another invisible parent object? I have these two objects pack inside different parents. I will probably consider the structure again if its not viable.

Yes. The steps to the math are basically:

  • subtract the offset
  • rotate the position (quaternion multiply)
  • add the offset back in
  • rotate the object’s orientation
1 Like

Hi, thank you for the explanation. I ended up using the first method and it works fine!