Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would i detect when a gui tween is done?

Asked by 4 years ago

So I'm trying to make an animated background for my game menu and i need to detect when the background is done tweening. I tried doing this but it kept erroring:

01local Patterntween = script.Parent:TweenPosition(
02 
03    UDim2.new(0.509, 0,1, 0),
04    Enum.EasingDirection.In,
05    Enum.EasingStyle.Linear,
06    10,
07    nil
08 
09 
10)
11 
12while true do
13    wait()
14    if Patterntween.Completed ==  true then
15        print("Tween done!")
16    end
17end

Someone please help!

1 answer

Log in to vote
1
Answered by 4 years ago

I think you have to check the status on it, here is the code to fix it.

1if Patterntween == Enum.TweenStatus.Completed then
2    print("The tween completed uninterrupted")
3end
Ad

Answer this question