TweenService Repeat Becomes Out Of Sync

When specifying a repeat count as part of the TweenInfo constructor, the Tween will eventually become out of sync.

This is evident if we create 4 Tween instances, with a delay of 0.2 before playing each one after another. At first, they behave as expected, but they will eventually become out of sync to the point where it can be considered random.

This usually happens between 2 to 5 minutes, but sometimes less than 2 minutes. It happens sooner if you are focused on another window.

Rep:
Rep.rbxl (17.1 KB)

3 Likes

If the Tween is a CFrame, then this is likely the dreaded Floating Point Error. The CFrame values will not be exact, for instance 0.4 may become 0.3999999999999999… Which for a short period of time may be unnoticeable, but over long duration’s becomes more prominent.

This has been known to happen with other properties, though I’m not sure of them all.

1 Like

Also I’m not entirely sure, but I would assume delay works similar to wait in which case the time it delays/waits is not always 100% the same. The wait only guarantees that it will wait for the specified amount of time, but can sometimes go small bits longer.

The tweens are not CFrames, but let’s presume your logic applies here.

This wouldn’t be the case, as if one experiences a floating point error, The rest would too. They should still remain in sync, and not act completely randomly after “x” minutes.

As for using wait(), this is a possibility, but it should not be used internally behind-the-scenes of the API Roblox provides. The wait() I used to start off the tweens doesn’t have an impact over a long duration, as it’s just purely to set the tweens off. They all act as expected at the start.