[Spine extension] How to check if an animation exists on a spine/model?

Good morning

Is there anyway to check if the spine animation exists on a model / scene?

Thank you for the help

No, there is no API function for this. Wouldn’t you know this as the game designer?

For some use case like fallback animation when an animation is not implement yet.

I suggest you wrap your call with pcall(fn, arg1, arg2)and handle any errors that way.

1 Like

Thank you for the time to reply

I have tried it but pcall always return true on spine.play_anim, i think no error is thrown when no animation is found

local stat = pcall(function()
  spine.play_anim(node, 'animation-name-test')
end)

// variable stat here is always true

That might be true. I suppose we could let the function return a boolean or add a function to list animations. Please create a feature request.