``````local TweenService = game:GetService("TweenService")

local parts = game:GetService("Workspace"):WaitForChild("partStorage")

local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out,-1)

local properties = {CFrame = part.CFrame * CFrame.Angles(math.rad(360),0,0)} -- Here
local tween = TweenService:Create(part,tweenInfo,properties)
tween:Play()
wait(2)
tween:Play()
end)
``````

I want the part to rotate 360 degrees, but it won’t rotate at all. It only works when `math.rad(180),0,0)`, but then it’s rotating 180 degrees. Does anyone know how to fix this?

does

``````math.rad(359)
``````

work?

Nope, `math.rad(359)` doesn’t work

That’s because rotating something by 360º is the same as rotating it by 0º.

You would have to rotate it by 180 120º three times.

2 Likes

How would i rotate it 180 degrees twice?

Ideally you would even split it into 120 degree increments to specify what direction you want to go

4 Likes

Nvm, do it in 120º increments as @PapaBreadd said as I wasn’t thinking about direction

``````parts.ChildAdded:Connect(function(part)
for i = 1,3
local properties = {CFrame = part.CFrame * CFrame.Angles(math.rad(120), 0, 0)
local tween = tweenService:Create(part, tweenInfo, properties)
tween:Play()
tween.Completed:Wait()
end
end)
``````
2 Likes

I tried this, but it’s rotating 120 degrees but then it resets

That’s because your repeat count is -1 meaning it’s going to repeat infinitely. You should change it to 0 or just remove that argument entirely.

1 Like

If you just want it to rotate continuously you don’t need tween service you can just change the CFrame yourself

``````local RADS_PER_SECOND = math.rad(360)
local RunService = game:GetService("RunService")
RunService.Stepped:Connect(function(t, dt)
part.CFrame = part.CFrame * CFrame.Angles(dt * RADS_PER_SECOND, 0, 0)
end)
end)
``````
3 Likes

It works when I remove it, but I want it to repeat infinitely, rotating 360 degrees. How would I do that?

Why not try `2 * math.pi` instead of `math.rad(360)`

1 Like

I see. You should use @nicemike40’s solution then as it will constantly rotate linearly.

You could also do a while true do loop but I think nicemike’s solution will be more performant.

1 Like

Isn’t TweenService better for performance?

Pretty sure TweenService uses runservice on the backend in combination with lerping. TweenService is mainly useful when you want to do different easing styles.

1 Like

If I had to guess, TweenService has a lot more overhead than the code I posted.