How do i make the model rotate slower

hello!
im currently made my model rotating, it might be a stupid thing but i dont know how to make the model rotation speed slower
here the script inside the model:

local model = script.Parent
local primPartCFrame = model:GetPrimaryPartCFrame()

i = 1
stuff = false
repeat
	local rotation = CFrame.Angles(0,math.rad(i),0)
	local rotCFrame = primPartCFrame * rotation
	model:SetPrimaryPartCFrame(rotCFrame)
	
	if i <360 then
		i = i +1 
	else
		i =1
	end
	wait()
until stuff == true
3 Likes

Change it to task.wait(1) or whatever you want it to wait. Also, I recommend tweening the rotation for a smoother effect.

with tweenservice it would be like this?

local TS = game:GetService("TweenService")
local model = script.Parent
local primPartCFrame = model:GetPrimaryPartCFrame()

local Tweeninfo = (2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false)
TS:Create(primPartCFrame,  Tweeninfo,  CFrame.Angles(0,math.rad(i),0)):Play()
1 Like

Gotta define i, and if you want it to repeat forever, change Tweeninfo to local Tweeninfo = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, false)

1 Like

it gives me an error in the output
Unable to cast dictionary
in the line 5 TS:Create(primPartCFrame, Tweeninfo, CFrame.Angles(0,math.rad(-120),0)):Play()

Can you tell my why your trying to spin the model(Like is it a door, etc)? There may be a more easier/efficient way.

its bc i have a menu where in the background there this model that is spinning to give it an effect like if the camera is rotating, but anyways i fixed it

1 Like

My bad, I forgot you needed {} around the property. Try TS:Create(primPartCFrame, Tweeninfo, {CFrame = CFrame.Angles(0,math.rad(-120),0)}):Play().