I'm trying to build a solar system and I have managed to make the moon follow the Earth but it won't spin around it. I've messed around with the script for half an hour now and need some help to figure it out.

local Earth = script.Parent.Earth

local Point = CFrame.new(Earth.Position)
	local Offset = CFrame.new(0,0,40)
	 
	local Object = script.Parent.Moon
	Object.Anchored = true
	 
	while true do
Point = CFrame.new(Earth.Position)

for i = 1,1 do
	Object.CFrame = Point * CFrame.Angles(0,math.rad(i),0) * Offset
	wait()
	end
end

1 comment

0

for i=1, 1 do