Orbiting Problems with CFrame!

Hello! I need some help with the following script…

local earth = workspace.Planets.Earth
local moon = workspace.Planets.Moon
local orgin = CFrame.new()
local Offset = 10000

local Theta = 0

while true do
	
	moon:PivotTo(orgin * CFrame.Angles(0, Theta, 0) * CFrame.new(0, 0, Offset))  
end

So as shown, I am trying to create an orbiting script. At the moment I have three models: The Sun, Earth, & Moon. The script above is meant to make the moon orbit around the Earth at the same time that the Earth is orbiting the Sun. If someone could help me figure out how to get the constant CFrame of the Earth to use as the orgin or another solution, that would be great! – if anymore specifics are needed let me know.

P.S: The script above is only for the moon.

1 Like

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