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?
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):
1 | local function on_tween() |
2 | -- Code |
3 | end |
4 |
5 | tween.Completed:Connect(on_tween) |
If you want to wait for a tween to finish playing before continuing script execution:
1 | tween.Completed:wait() |