How can I detect if a animation is finished playing?
Or to add on the above answer, you can wait until it is done playing in the same block of code.
1 | local animationTrack = humanoid:LoadAnimation(animationInstance) |
2 | animationTrack:Play() |
3 | wait(animationTrack.Length) |
4 | --finished playing |
If you have the animation track stored in a variable, you can use its Stopped event.
1 | myAnimTrack.Stopped:Connect( function () |
2 | -- do things |
3 | end ) |