I want to check to see if an animation is playing on a character.
There's a property called "IsPlaying" in animations that returns either true if the animation is playing or false if it isn't
Example:
01 | local function AnimPlaying(animation) |
02 | if animation:IsA( "AnimationTrack" ) then |
03 | if animation.IsPlaying then |
04 | print (animation.Name.. "is playing." ) |
05 | return true |
06 | else |
07 | print (animation.Name.. "is not playing." ) |
08 | return false |
09 | end |
10 | else |
11 | error (animation.Name.. "must be an AnimationTrack." ) |
12 | end |
13 |
14 | AnimPlaying(animation) |
Use a debugging variable to define when the animation has started and stopped
1 | --this is an example and not an entire animation script |
2 | local animplaying = false |
3 | function loadtrack() |
4 | animplaying = true |
5 | wait(track.length) |
6 | animplaying = false |
7 | end |