I have a class with my Client and Room variables in Unity.
I was using just one Scene in Unity, and the game was working fine.
When the game starts, I am using ColyseusManager.room.State.TriggerAll(); to receive the changes from the server.
But then I decided to make two scenes for better organization of my game:
- The Scene 1 have a button to the game leader send a command to the server to start the game.
- The Scene 2 is the game itself.
Both of these scenes use the static variables (room and client) from my singleton class.
The problem is that, after starting another scene, the method TriggerAll() throws this exception:
Thanks for any help!