I have 4 scenes in my game. Boot, Menu, Game and GUI
“Game” and “GUI” scenes are connected together, and can communicate each other by using Event emitter
let ourGame = this.scene.get('main_game'); //GUI let uiEvent = this.scene.get('game_ui'); //Game
This is a method what i used to show ‘GUI’ scene
This script are placed at top inside create() function on Game scene.
On first play, there is no problem at all.
But if Game scene are restarted or re-launch again, the problem are appears.
It’s like: Menu -> Game (GUI Launched) -> Back to Menu -> Start Game scene again -> Some ERROR
and the result are same if directly restart/relaunch Game scene
Here is a sample a text object before and after restart.
Before / First play
After / Second play
Object scene are undefined, even all object on GUI scene are already created and shown correctly, but i can’t change it’s text value, then return error.
I can send emit to ‘GUI’, but from ‘GUI’ can’t send to ‘Game’ via Event emitter, Sometimes a parameter from ‘Game’ to ‘GUI’ just return NaN
This is how i change the scene/back to menu
Any help ?