Make Continuous Smooth Tweening

I am making a slot-type GUI for my game and came across a small pretty annoying issue. I tween frames to move to a different position every x seconds but It looks very unnatural. I can’t find a way to fix this. Thanks so much if you could help! :slight_smile:

robloxapp-20211024-1202171.wmv (349.2 KB) – Sorry for the horrible video quality

Code
while true do
	local info = TweenInfo.new(speed, Enum.EasingStyle.Sine)
	for _, item in pairs(script.Parent:GetChildren()) do
		if item:IsA("ViewportFrame") then
			local slot = tonumber(item.Name)
			local nextSlot = slot + 1
			if nextSlot >= 8 then 
				nextSlot = 1
			end
			item.Name = tostring(nextSlot)
			if nextSlot ~= 1 then
				TweenService:Create(item, info, {Position = positions[nextSlot]}):Play()				
			else
				item.Position = positions[nextSlot]				
			end
		end
	end
	speed += .025
	wait(speed)
end
1 Like

Try Linear EasingStyle, maybe this will solve your problem, I watched the video but it looks normal (due to quality) so hopefully this is what you wanted.

Script

while true do
	local info = TweenInfo.new(speed, Enum.EasingStyle.Linear)
	for _, item in pairs(script.Parent:GetChildren()) do
		if item:IsA("ViewportFrame") then
			local slot = tonumber(item.Name)
			local nextSlot = slot + 1
			if nextSlot >= 8 then 
				nextSlot = 1
			end
			item.Name = tostring(nextSlot)
			if nextSlot ~= 1 then
				TweenService:Create(item, info, {Position = positions[nextSlot]}):Play()				
			else
				item.Position = positions[nextSlot]				
			end
		end
	end
	speed += .025
	wait(speed)
end
1 Like