TweenBase:Pause() does not work when PlaybackState is Enum.PlaybackState.Delayed

PC Info: Windows 11, 23H2
Date First Experienced: 2/16/2024
Date Last Experienced: 2/16/2024

Reproduction steps:
1. Open up roblox studio, create a part, parent it to workspace.
2. Run something like the below code at console or in game to create a tween for a part, this code fills Delay argument of TweenInfo.new(), making tween start at Enum.PlaybackState.Delayed.

local tween = game:GetService("TweenService"):Create(workspace.Part, TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 2), {CFrame = CFrame.new()})
tween:Play()
tween:Pause()

This is a very basic example of this behaviour. Can cause a headache for developers, as I did not even know about it. If the behaviour should be like that, this must be on documentation. You may ask why pause it as soon as it starts to play, it is not that simple, having functions for chain tweening, also skills that stops the time combined can make things get pretty complicated.

We can overcome this with something like observing state change, and pausing the tween after state changes, but finding this bug was hard for me and might be for other developers aswell.

Expected behaviour: This behaviour should be on TweenBase | Documentation - Roblox Creator Hub or Tween should be able to pause at Enum.PlaybackState.Delayed state which means as soon as it leaves the state.
Actual behaviour: Tween can’t be paused at Enum.PlaybackState.Delayed state. Pause method does not warn us about state. Documentation does not hint to this as far as I saw.

Edit: My bad, I meant Enum.PlaybackState.Delayed at behaviour texts, fixed it now.

4 Likes

We’ve filed a ticket into our internal database for this issue, and will come back as soon as we have updates!

Thanks for flagging!

3 Likes

Also it is not a studio bug, this post was about documentation issue (or engine bug if you guys find it reasonable).

1 Like

Hi, thank you for reporting this, I have filed a change request for the docs. Note that now anyone can update the docs using the “Edit” button in the Developer documentation.
image

1 Like

Hi @sinanxd2,

The docs for the Pause have been updated. Please let us know if this clarifies the issue.

1 Like

Yes, that should do. Thank you very much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.