Hey guys,
I’m working on a matchmaking multiplayer game. I’ve got a matchmaking lobby scene as my offline scene (with buttons to create and join rooms), and a game scene where the game is actually played. Inside the game scene I’ve got two scene objects: GameManager which controls the logic for the game, as well as holding the Rpc calls and such, and GameInfo which has a number of SyncVars about the game state.
Everything works perfectly fine when a player hosts a game and plays on their own. However, if someone tries to join the hosted room, I get a number of issues:
- Switching to the game scene takes a relatively long time (15 to 20 seconds, I’m using the default NetworkManager.singleton.OnMatchJoined(aMatchResponse) call back in the JoinMatch function)
- When switching to the new scene, the newly joined player’s GameManager and GameInfo objects are disabled in the scene, and calling Network.SpawnObjects() returns true but doesn’t actually enable them.
- I have a very simple custom NetworkManager class that overrides two methods: OnServerAddPlayer, and OnClientSceneChanged. Neither of them do all that much different than the base functions, just initializing some information and such. After the new player joins the room, however, the “OnClientSceneChanged” function is being called four times a second until I end the program!
All of these problems only happen if a client that isn’t the host tries to join a hosted room.
Has anybody got any idea why this stuff is happening? Am I doing something incorrectly?