d13 Posted August 10, 2020 Share Posted August 10, 2020 Hi Everyone, I'm using the SceneManager to start a scene. I then want initialise other parts of my game when the scene has started and is is ready. I've tried this (`game` is a new Phaser.Game(config)): game.scene.start("TitleScreen"); const titleScreen = game.scene.getScene("TitleScreen"); ... but titleSceen is `null`, preventing me from attaching any event listeners to it. However, if I wrap it in setTimeout and wait for 100 ms, I can access it: game.scene.start("TitleScreen"); setTimeout(event => { const titleScreen = game.scene.getScene("TitleScreen") console.log("It works!: ", titleScreen) }, 100); This is a hack, of course. Is there some way to listen for a scene "ready" events globally like this? (outside of scene objects themselves?) Hope that's clear..? Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts