[SOLVED] Getting the current animation of an entity?

Is it possible to get the current animation that is playing on an entity? :thinking:


Thanks.

Hi @Fus_ion,

Indeed there isn’t a method or property exposed for that in the animation component. Of course if you’ve started playing the animation in code you could keep the animation name in a variable of yours.

Otherwise looking at the engine source code there is a property not exposed as a public API that can be of help:

// gets the name of the current animation playing
entity.animation.data.currAnim;
1 Like

It worked thanks!

1 Like

Does it apply the same for a sprite?