Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I check if an animation is playing?

Asked by
Lucke0051 165
6 years ago

I want to check to see if an animation is playing on a character.

3 answers

Log in to vote
2
Answered by
metryy 306 Moderation Voter
6 years ago

There's a property called "IsPlaying" in animations that returns either true if the animation is playing or false if it isn't

Example:

01local 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.")
12end
13 
14AnimPlaying(animation)
Ad
Log in to vote
0
Answered by 6 years ago

Check this wiki link: here

Log in to vote
0
Answered by 6 years ago

Use a debugging variable to define when the animation has started and stopped

1--this is an example and not an entire animation script
2local animplaying = false
3function loadtrack()
4animplaying = true
5wait(track.length)
6animplaying = false
7end

Answer this question