Janne October 5th, 2019 Hi,
how to check onUpdate if sceneobject has specific animation running at the moment or not?
And is there any possibility to run animation ( example onKeyDown: this.playAnimation("swingSword")) only one time,
and after that animation ends, change to another animation automatically active?
Thanks!
Gio October 7th, 2019 Hi Janne
To check if a specific animation is playing, you could do something like this
if (_.myObject.getSprite().getCurrentAnimationName() == 'myAnimation')
{
// do something here
}
If you want to play a specific animation after another one finishes, for example you want to play a 'dance' animation once your 'swingSword' animation is over, you can do this:
_.myObject.playAnimation('swordSwing');
_.myObject.onAnimationEnd = function()
{
this.playAnimation('dance');
this.onAnimationEnd = null;
};