-- make the earth circle the sun around the y axis every 20 seconds
-- maintain the current distance between the earth and sun
-- update the rotation every 1/60s

local function orbitEarth()
    local angle = 0
    while true do
        wait(1/60)
        angle += (2*math.pi)/1200 -- 20 seconds to complete a circle
        earth.Position = sun.Position + Vector3.new(math.cos(angle), 0, math.sin(angle)) * distance
    end
end


