phaser
phaser copied to clipboard
Adding a scene can fail in HEADLESS mode
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.
#5872
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master
branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.