Ad
Log in to vote
0

How would i detect when a gui tween is done?

Asked by 2 months 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:

local Patterntween = script.Parent:TweenPosition(

    UDim2.new(0.509, 0,1, 0),
    Enum.EasingDirection.In,
    Enum.EasingStyle.Linear,
    10,
    nil


)

while true do
    wait()
    if Patterntween.Completed ==  true then
        print("Tween done!")
    end
end

Someone please help!

1 answer

Log in to vote
1
Answered by 2 months ago

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

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

Answer this question