Skip to content

Calling play() on fresh paused tween doesn't play it #6005

@MartinEyebab

Description

@MartinEyebab

Version

  • Phaser Version: Phaser v3.60.0 Beta 4
  • Operating system: Windows 10 & iPad OS 15.3

Description

The docs for Tween.play() say "You only need to call this method if you have configured the tween to be paused on creation."
However as demonstrated by the standalone test case below, calling Tween.play() immediately after it was added with scene.tweens.add doesn't actually play the Tween.

Example Test Code

const config = {
  width: 800, 
  height: 600,
  scene: {
    create,
  },
};
const game = new Phaser.Game(config);

function create() {

  const circle = this.add.circle(100,100,20, 0xffffff);
  const tween = this.tweens.add({
    targets: circle,
    alpha: 0,
    duration: 1000,
    paused: true,
  })
  tween.play()
}

Expected result: circle fades away
Actual result: circle doesn't fade away

Additional Information

#5454 might have something to do with it

Edit: Locally undoing the 5454 commit, fixes the issue so the tween plays correctly

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions