Skip to content

TweenChain onStart doesn't get called #7007

Closed
@Stever1388

Description

@Stever1388

Version

  • Phaser Version: Phaser 3.86.0
  • Operating system: Windows
  • Browser: Chrome

Description

Adding onStart listeners to a tween chain object doesn't do anything, the callback isn't called when the chain actually starts. The documentation for TweenChain (here) mentions that onStart is a valid config property and should be called when the chain starts.

Example Test Code

export default class ChainOnStartIssue extends Phaser.Scene {
  create() {
    this.objToTween = this.add.circle(this.scale.width / 2,this.scale.height / 2,50,0xff0000);

    const chain = this.tweens.chain({
      tweens: [
        { targets: this.objToTween, duration: 500, props: { alpha: 0 } },
        { targets: this.objToTween, duration: 500, props: { alpha: 1 } },
        { targets: this.objToTween, duration: 500, props: { alpha: 0 } },
        { targets: this.objToTween, duration: 500, props: { alpha: 1 } },
      ],
      onStart: () => console.log('chain start!')
    });

    chain.on(Phaser.Tweens.Events.TWEEN_START, () => console.log('added on start listener')); // I assume this should work
  }
}

Both callbacks do not get called (nothing is output to the console).

Additional Information

As far as I know, the other callbacks work (onComplete for example).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions