Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a scene can fail in HEADLESS mode #5974

Closed
samme opened this issue Jan 17, 2022 · 2 comments
Closed

Adding a scene can fail in HEADLESS mode #5974

samme opened this issue Jan 17, 2022 · 2 comments

Comments

@samme
Copy link
Contributor

samme commented Jan 17, 2022

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.

@samme
Copy link
Contributor Author

samme commented Feb 5, 2022

#5872

photonstorm added a commit that referenced this issue Nov 23, 2022
…ing` before `PRE_RENDER`. This fixes issues in HEADLESS mode where the Scene Manager wouldn't process additionally added Scenes created after the Game had started. Fix #5872 #5974
@photonstorm
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants