Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local centerPart = workspace.CenterPart
- local orbitPart = workspace.OrbitPart
- local offset = 10
- local orbitCompletionTime = 5 -- in seconds, roughly since wait() times can change
- while wait() do
- local startTime = tick()
- local frameTime = wait()
- for theta = 0, math.pi * 2, (math.pi * 2) / (orbitCompletionTime/frameTime) do
- orbitPart.CFrame = centerPart.CFrame * (CFrame.Angles(0,theta,0) * CFrame.new(0,0,offset))
- wait()
- end
- print(("Orbit completed in %s seconds."):format(tick() - startTime))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement