Is there a way to determine when a tween has completed?

Hey, so I really remember reading up on there being some event or function I could use to determine once a tween created with TweenService has completed.

Is there any way to do this?? Thanks.

9 Likes
5 Likes

That is Tween.Completed

local t = game:GetService("TweenService"):Create(datahere)

t.Completed:Connect(function()

end)
31 Likes

I usually create a function to play and :Wait on Completed:

function playSync(tween)
    tween:Play()
    tween.Completed:Wait()
end

It saves writing it a billion times.

34 Likes

btw you have to do

local tween = ts:Create(…)
tween:Play()
tween.Completed:Wait()

not

local tween = ts:Create(…):Play()
tween.Completed:Wait()

1 Like

why did you necro a 5 year old thread to provide a correction to an error that doesn’t even exist in said function

1 Like

btw you have to do

local tween = ts:Create(…)
tween:Play()
tween.Completed:Wait()

not

local tween = ts:Create(…):Play()
tween.Completed:Wait()

*edited for clarity :+1:

Thanks,

Contributed 0 visits.

1 Like