How to make one object rotate around another one, like in a solar system?

Hi,

How to make one object rotate around another one, like in a solar system? I want one of my objects to rotate around another one, how I can achieve this?

Thanks.

Transform.RotateAround

You need to rotate the transform of the rotator around the position of the rotatee’s (did I just inventify a word) transform.

You can do this using RotateAround: Unity - Scripting API: Transform.RotateAround

Good luck!

When I was doing this exact thing I cheated. I treated it as if it were a model solar system, so each planet was actually a sphere on a stick, with the zero point of the prefab being the end of the stick that’s “embedded” in the central sun. That was many months ago now, so there are probably better approaches.