skeleton:findAnimation()

Type: function
See 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:


  • booleantrue if animation is found, false otherwise.

Example:


local canDance = hero:findAnimation("dance")
if canDance then
    hero:setAnimation(1, "dance", true)
end