Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I check if an animation is playing?

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

3 answers

✓ Accepted answer

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

Example:

local function AnimPlaying(animation)
	if animation:IsA("AnimationTrack") then
		if animation.IsPlaying then
			print(animation.Name.."is playing.")
			return true
		else
			print(animation.Name.."is not playing.")
			return false 
		end
	else 
	error(animation.Name.."must be an AnimationTrack.")
end

AnimPlaying(animation)

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

--this is an example and not an entire animation script
local animplaying = false
function loadtrack()
animplaying = true
wait(track.length)
animplaying = false
end

This discussion is preserved as it was. New answers, comments, and votes are closed.