Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a tweening value loop forever?

Hi, I was trying to tween a boat and I noticed that I couldn't make it so the boat could infinitely go back and fourth. Could somebody please help me?~~~~~~~~~~~~~~~~~

local tweenService = game:GetService("TweenService") local part = script.Parent

local tweenInfo = TweenInfo.new(

5,
Enum.EasingStyle.Sine,
Enum.EasingDirection.InOut
inf, 
false
0


)

 

1 answer

✓ Accepted answer

Instead of using inf as your repeat count, use -1. It is more reliable than inf, which may get unstable.

To make your boat go back and forth, change your false to true. This is the "Reverses" bool of TweenInfo.new. Once your tween plays, it will repeat in the opposite direction.

Hope this helps!

1 comment

0

thx

This discussion is preserved as it was. New answers, comments, and votes are closed.