L2L2L Posted December 29, 2014 Share Posted December 29, 2014 I am trying to add a tweendata dynamically to an tween object, while the tween object property isRunning set to true. I figure a solution for my problem out. But I feel I should be able to get this to work too. Have a look and please get back to me on what is missing. ()=>{ var child = new Phaser.TweenData(tween); child.from({x: child.target.position.x, y:child.target.position.y}).to({x:-75,y:75}, 1000, Phaser.Easing.Circular.InOut,0,0,true); tween.timeline.push(child); child.parent.onComplete.addOnce(()=> (target, tween){ console.log('tween:',tween, 'target:',target); //try calling child.start() to run it manually here, //...remove child from tween to stop repeat. if you know a better way via library 'Phaser' to do this, please share. }); } Link to comment Share on other sites More sharing options...
Recommended Posts