How to rotate parts

How would I get a model to rotate about 60 degrees and then rotate back the other way 60 degrees?

I have this but this obviously just continuously rotates in a full circle.

while true do
	
	local rotation = CFrame.Angles(0, math.rad(7.5), 0)
	local antirotation = CFrame.Angles(0, math.rad(-7.5), 0)
	local modelCFrame = script.Parent:GetPivot()
	
	script.Parent:PivotTo(modelCFrame * rotation)
	
    task.wait(0.05)
end 

Sounds like a sin() or cos() curve you can model it using 60*sin(os.clock()).

Or if you want it to go linearly you can use tween service.

1 Like