Roblox Reverse Orbit

Howdy y’all! I’ve been working on an experience where you can build a space station around multiple different bodies in space, my only issue is that I have no idea how to performantly display orbits.

It appears I have one of two options (let me know if there’s anything else):

  • Orbit the entire Space Station around the Planetary body
  • Orbit the Planetary body around the Space Station

You’d probably be like “Why would you orbit the planet around the player?? That’s not how it works in real life!” and that’s very true! But I ran into an issue with this, due to the high part count of the space station it may not be a very smart idea to move the entire thing 24/7.

The second option may make more sense for this case, move the large body (less parts*100) around the player. But how can we make it convincing?

I’ve seen hundreds of posts about how to make planetary orbiting, but never one about how to trick the player into believing he or she is actually going around the planet!

Here’s an example of what that’d visually look like:

An example of what would actually be taking place:

So in the end, what’s the best way to convince the player he or she is moving when in a completely locked position?

I’m not sure whether this is correct but the idea should work:

local stationPos = calculateOrbitPosition(...) -- CFrame

planet:PivotTo( stationPos:ToObjectSpace(planet:GetPivot()):Inverse() )

This should basically convert the offset from the station to the planet to the offset from the planet to the station (with rotation and etc.) making it look the you’re moving while the planet is instead.

Unexpectedly this was super easy, I just reversed the instances by making the planet calculate the CFrame around the station and it looked perfect.

This most-likely would’ve worked as well though I didn’t try this

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.