horror812 Posted March 16, 2015 Share Posted March 16, 2015 Hi all How correctly destroy old animations? for example: //# createsprite.animations.add('run',[1,2,3]);//# remove old sprite.animations.remove('run'); /// ? ? ?//# or allsprite.animations.removeAll(); /// ? ? ? Link to comment Share on other sites More sharing options...
trueicecold Posted March 16, 2015 Share Posted March 16, 2015 To remove a specific animation:sprite.animations.getAnimation("run").destroy();To remove all animations from a sprite:sprite.animations.destroy() Link to comment Share on other sites More sharing options...
horror812 Posted March 16, 2015 Author Share Posted March 16, 2015 #trueicecold, thx for response, but this method don't work for meI want to revive old sprite with other animation after killedfor example: sprite.animations.add('explosion',[1,2,3])sprite.play('explosion',12,false,true) // kill on complete //# after kill -> use old this sprite sprite.revive();sprite.animations.destroy()sprite.animations.add('other',[3,2,4])sprite.play('other'...)then in animation update error : "Uncaught TypeError: Cannot read property 'getFrame' of null"Phaser.Animation.update -> Phaser.AnimationManager.update -> Phaser.Sprite.preUpdate Link to comment Share on other sites More sharing options...
Recommended Posts