Playing tween immediately after tween.Completed:wait() causes crash

###Problem:
The following code causes the game to crash after the first tween has completed fading out and then back in:

local tween= tweenService:Create(
	label,
	TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0,true,1),
	{ TextTransparency = 1 }	
)

while true do
    tween:Play()
    tween.Completed:wait()
    print("Completed")
end

Repro.rbxl (14.7 KB)

Replacing true with wait() prevents the crashing, and the printing of “Completed” shows that the event is correctly firing after the tween completes and not every frame/etc.

###Expected Behavior:
Tween animation to loop indefinitely without crashing (same behavior as while wait() do sans the wait)

5 Likes

Also crashes when using for i=1,10 do instead of while true do, so it’s not an infinite loop, but it not liking restarting the animation during the Completed event handler (probably?)

1 Like

I’ll check this out, thanks for the report

3 Likes

Should no longer be an issue

10 Likes

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