Rotating the part around the player

I just want to know how to make a part that revolves around the player.

I can’t think of any ideas how to make a rotating part around the player please help me

I tried to find information on the Internet, but I couldn’t find the script I needed, so I turned to this forum.

1 Like

For this you’d want to use CFrame and probably a run service heartbeat loop. Make an outside variabel to save the current rotation and inside the loop add the delta time to the rotation (possible times some extra depending on desired speed). Set the parts CFrame inside the loop to the origins position (in this case probably humanoid root part) and add the rotation. Then add an offset to the Z axis to move it away from the character. This will make the part spin around the character and also make it face towards them.

something like this

local offset = 4
local speed = .2
local rotation = 0
runservice.Heartbeat:Connect(function(delta)
    local origin = Vector3.new()
    rotation += delta * speed
    part.CFrame = CFrame.new(origin) * CFrame.Angles(0, math.rad(rotation), 0) * CFrame.new(0, 0, offset)
end)

Found a very similar topic here might be helpful for you