Rotate about a point continuously

Title. I am tweening something so that it basically rotates a certain degree about a point, and then goes to the opposite degree about a point. Like a metronome.

No idea where to begin with this. I’ve already teached myself how to tween and all that, but my main question is the math.

This used to be a little more complicated with using CFrames, but I think you can now just set a part’s pivot point to the bottom and then just tween the part’s orientation from there. (If you can’t, check the “Understanding CFrames” article for an example.)

Oops. This doesn’t seem to be working. Not much experience with CFrame in a while either.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage.TweenRemote
local tail = script.Parent

local info = {1,Enum.EasingStyle.Quart,Enum.EasingDirection.In,math.huge,true,0}
local cframe = CFrame.Angles(24.09, math.rad(-83.12), 16.47)

remote:FireAllClients(tail, info, {CFrame = cframe})

Ah ok, here’s another method you can use from the Rotating a Door example in the CFrame Math Operations article:

local door = game.Workspace.Door
local hinge = game.Workspace.Hinge
 
local offset = hinge.CFrame:inverse() * door.CFrame; -- offset before rotation
game:GetService("RunService").Heartbeat:connect(function(dt)
	hinge.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(1)*dt*60, 0) -- rotate the hinge
	door.CFrame = hinge.CFrame * offset -- apply offset to rotated hinge
end)

This has a “hinge” part that the door rotates around the center of, and a “door” that rotates around the hinge. In your case, the center part would be your “hinge”, and the “door” would be your needle.

Hope this helps!

Also, the pivot point thing does not work. I found a way to tween it’s CFrame.Angle but it is not doing it around my pivot point. I will try your other method though