I am made a gear Model and I am trying to write a script for it to rotate with the angle 45 degrees. But there was a problem in my script, I can’t control the rotation speed
I already made the rotateAmount inside the script but if I insert any numbers except for 0, I can’t control the rotation speed and the gear would go crazy and spin with some weird angles and speed.
The rotateAmount with other numbers:
TherotateAmount with 0:
Script
local model = script.Parent
local rad = math.rad
local rotateAmount = 1 -- In degrees
while true do
wait(0.002)
local newCFrame = model.PrimaryPart.CFrame * CFrame.Angles(45, rad(rotateAmount),0)
model:SetPrimaryPartCFrame(newCFrame)
end
Is there any other ways to fix this or there are some better scripts for this? Please help