skeleton:findAnimation()¶
Type:
functionSee also: skeleton
Overview:¶
Checks if an animation with the given name exists in the skeleton’s data.
Syntax:¶
local exists = skeleton:findAnimation(animationName)
animationName(required):string– Name of the animation to check.
Return value:¶
boolean– true if animation is found, false otherwise.
Example:¶
local canDance = hero:findAnimation("dance")
if canDance then
hero:setAnimation(1, "dance", true)
end