Skip to content

Adding a scene can fail in HEADLESS mode #5974

Closed
@samme

Description

@samme

Version

  • Phaser Version: 3.55.2

Description

In a headless game, if you add a scene after at least one scene manager update (I think), the scene never gets added.

Example Test Code

Here Add is printed but Hello is not.

class MyScene extends Phaser.Scene {
  create() {
    console.log("Hello");
  }
}

class BootScene extends Phaser.Scene {
  create() {
    this.time.delayedCall(100, () => {
      console.log("Add");

      this.scene.add("myScene", MyScene, true);
    });
  }
}

new Phaser.Game({
  type: Phaser.HEADLESS,
  scene: BootScene
});

Additional Information

The problem is that the headless scene manager never resets its isProcessing property.

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