selvam Posted July 29, 2016 Share Posted July 29, 2016 Hi guys, Here i need to contorl some sprite animation during it play, so onUpdate event is required here but that event not fired. my code is: var sprite2; var animEvent; sprite2 = mainGame.add.sprite(0,0, 'anim'); sprite2.animations.add('walk'); animEvent=sprite2.animations.add('walk'); animEvent.onComplete.add(onAnimComplete,this); animEvent.onUpdate.add(onAnimUpdate,this); animEvent.play(10,false); Here onAnimComplete method working fine, but onAnimUpdate method not fired. so can anyone help me to handle onUpdate event for sprite animation. Thanks, Selvam Link to comment Share on other sites More sharing options...
s4m_ur4i Posted July 29, 2016 Share Posted July 29, 2016 you have to set: animEvent.enableUpdate = true;http://phaser.io/docs/2.3.0/Phaser.Animation.html Link to comment Share on other sites More sharing options...
Recommended Posts