Waiting for animation to stop using task.wait() instead of wait()

I’ve heard that using task.wait() is a lot better than using wait() so I’m trying to avoid using wait(). I’m wondering if there’s a way of using task.wait() with AnimationTrack.Stopped. What I mean is can you only use AnimationTrack.Stopped:wait() to wait for an animation to finish or is there something like AnimationTrack.Stopped:task.wait() and would there be any benefit in doing so. When I try to do AnimationTrack.Stopped:task.wait(), it just errors.

I’m sorry if this sounds stupid, a lot of people say using task.wait() is better and I just want to know if that would be possible in this scenario and would it give you any benefit or does using AnimationTrack.Stopped:wait() do the same thing.

You’re getting wait() and Wait() confused.

AnimationTrack.Stopped:Wait() yields the thread until the animation track’s Stopped event fires. wait() and task.wait() are globals which yield the thread for an arbitrary length of time (specified by the function’s argument).

1 Like

Oh I thought AnimationTrack.Stopped:Wait() did kind of the same thing as wait(), thank you!!