jake.caron Posted September 26, 2018 Share Posted September 26, 2018 Hi All, I'm simply trying to kill/destroy a tween so it stops as soon as I call the method. I have tried the following code: this.tweens.add({targets: this.titleGraphic, scaleX: 1, scaleY: 1, duration: 1000, ease: Phaser.Math.Easing.Back.Out}); this.tweens.killTweensOf(this.titleGraphic); However, that does not seem to work. this.tweens.killAll(); also does not work. "this" is a reference to the current scene. Thanks, Jake. Link to comment Share on other sites More sharing options...
cornstipated Posted September 27, 2018 Share Posted September 27, 2018 var tobeinterrupted = this.tweens.add({targets: this.titleGraphic, scaleX: 1, scaleY: 1, duration: 1000, ease: Phaser.Math.Easing.Back.Out}); tobeinterrupted.stop(); This is the controlled way to do it with single tween granularity. Anyhow both your ways should work too you should try better or more specific test cases jake.caron 1 Link to comment Share on other sites More sharing options...
jake.caron Posted September 27, 2018 Author Share Posted September 27, 2018 <tween>.stop() does stop the tween which is nice, although I do wish that killTweensOf and killAll would work as well. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts