The simplest way I’ve been able to make something orbit something else is by giving it a Rotating Movement component and moving its pivot around. However, this means the planet does exactly one rotation per orbit, which looks really bad. Also, I haven’t found a way to attach a pivot point to anything; I don’t know if it’s possible.
In blueprint, I tried to make a script that updates a direction vector from the locations of the star and planet, rotates it 90 degrees on the X axis, and moves the planet along it every tick. Unfortunately, I apparently don’t know the proper way of moving things along changing vectors, because the script I came up with just makes the planet go off in a line. Here’s what I came up with:
I want to make an actor class for planets or moons that starts rotating and orbiting a parent actor when spawned, but I have to figure out how to make an actor orbit correctly first.