Jump to content

[Solved] Tweening a property sets the value to NaN?!


QLNEO
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...