I’m trying to make a fan spin, so I used a tween to make it spin 360 degrees. The problem is, everytime it makes a full rotation, it loops, but not seamlessly. You can easily see it restart. Whats the fix, or workaround for this?
Video:
Code:
local TweenService = game:GetService("TweenService")
local part = script.Parent
local tweenInfo = TweenInfo.new(
5, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
-- create two conflicting tweens (both trying to animate part.Position)
local tween1 = TweenService:Create(part, tweenInfo, {Rotation = Vector3.new(0, 360, 0)})
-- listen for their completion status
tween1.Completed:Connect(function(playbackState)
end)
-- try to play them both
tween1:Play()