Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I know when a tween is finished playing?

Is there a certain function for this, or do I just make a loop and check when it has reached the position in vector3 value?

1 comment

1

There is an event for a Tween object called "Completed". This should be what you need. Also, do you have a script so we can take a look at how you tried to do this?

1 answer

✓ Accepted answer

The Tween class possesses an event called Completed that does exactly what you would expect it to. A couple applications:

If you want something to happen every time any tween finishes (useful for multiple tweens or reusing the same tween instance):

local function on_tween()
    -- Code
end

tween.Completed:Connect(on_tween)

If you want to wait for a tween to finish playing before continuing script execution:

tween.Completed:wait()

This discussion is preserved as it was. New answers, comments, and votes are closed.