I need help with revolving objects

How are the objects continuing to revolve around the player as the player moves? I figured out the sin() and cos() script to make parts revolve in place, but I want the parts to follow my character when I walk. Any ideas how I could do that?

Here’s the game if you want to see what I’m talking about.

Heres the post I got the script from: How to make a part move within a radius of a circle around another part - Help and Feedback / Scripting Support - DevForum | Roblox

local originPart = script.Parent.Head
local orbitingPart = workspace.Part
local radius = 5

game:GetService("RunService").Heartbeat:Connect(function()
	local newCFrame = originPart.CFrame + Vector3.new(radius * math.cos(os.clock()),0,radius * math.sin(os.clock()))
	orbitingPart.CFrame = newCFrame
end)
1 Like