Orbit a moving object


So I’m trying create a model solar system, and so far I’ve managed to have one object orbit a stationary object (planet / sun), now how do I get an object to orbit a moving object? The best I have managed is to do is to get the “moon” to orbit an empty space near its starting position (using rotation and physics constraint components). I’ve looked into spring arms, but so far I haven’t had any success.

Any suggestions?

how did i know there would be no answers to this question even 4 years later…

this what i come up with
https://i.imgur.com/RrPvxxe.mp4 (video)

In the video you will see a spaceship trying to catch the pink sphere thats bound to the target actor. The blueprint is trying to find vector ahead of the spaceship at a 25 degree angle (180 - 155) but as close to target actor dictated by orbit distance. For other things you can just use SetActorLocation & Rotation, or in my case have spaceship follow the sphere vector. This works with poor framerate & low tick rate. In video the actor tickrate is set to 0.1.

A way to make better would be to detect if on left/right side of target to change OrbitDirection automatically. It stupid simple and works but its lacking so many important orbiting mechanics :frowning: