How do I rotate a part around another one?

So, I’m trying to make this siren light thing and tried to make the “light” rotate around the center (if that makes sense) but failed. I’ve set the pivot point to the center.

image


Script:

while wait() do
	script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0.1,0,0,0.0)
end

Hi @devwingfr !

Here’s an article on how to use PivotTools in your scripting. Hope it helps;

Pivot Tools | Roblox Creator Documentation.

local Ball = workpace.Ball --Set this to the ball
local Cone = script.Parent

while true do
	Ball.CFrame *= CFrame.Angles(0.1, 0, 0)
	Cone.CFrame = Ball.CFrame * CFrame.new(0, 0, -3) --Change -3 to the distance
	task.wait()
end

1 Like