Rotate object around Center of Mass

Hi, I’m trying to make a non hard-scripted solar system where I can add planets and they automatically orbit. I’m currently setting the center of mass to be the default starting point (sphere named Solar Start) and trying to rotate it around that center of mass but I can’t seem to figure out how exactly to rotate it around that point instead of the planet’s center. All help would be appreciated!

Here is a function I made in Blueprints before that might be helpful for what you want:

In it’s current form it just rotates around the world Z axis, but you could change that at the RotateVectorAroundAxis node. The AddActorLocalRotation node you probably won’t need, it’s making the orbiting object rotated to face the center vector.

This function would go in the actor you want to orbit, and called on tick.

It works like a charm! Thank you so much for the help!

Great :slight_smile: You can mark this answer as resolved by accepting the answer if this is working.