###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)