QLNEO Posted September 21, 2017 Share Posted September 21, 2017 What I'm trying to do is to set an internal value to change via a tween invoked inside that same object. IDK if that's even legal but that's what I'm doing right now. class TheObject extends Phaser.Sprite { constructor() { ... this.circleAngle = 90; game.add.tween(this) .to({circleAngle: 360}, this.period*1000, null, true, 1000, -1) .onUpdateCallback(function(tween, value) { console.log(value); // NaN! }) } } The idea is to loop circleAngle continously, but all the tween's doing is NaNing it. Any ideas on how to make it really interpolate as I intended? Link to comment Share on other sites More sharing options...
Skeptron Posted September 21, 2017 Share Posted September 21, 2017 Are you sure this.period is correctly defined? Link to comment Share on other sites More sharing options...
QLNEO Posted September 21, 2017 Author Share Posted September 21, 2017 13 minutes ago, Skeptron said: Are you sure this.period is correctly defined? It wasn't, of course. I forgot to fix the name. Huge thanks! Link to comment Share on other sites More sharing options...
Recommended Posts