- Home /
Unity Networking: How to prevent reloading scene when joining game fails?
I'm making a multiplayer lobby for my game, and I've been using the Network Lobby sample package on the Unity Asset Store as reference. In the sample package, whenever the Join button is clicked, and it couldn't connect to a server, it will go back to the main panel, showing an error popup (without reloading the scene, AFAIK.) But on my implementation, the error popup would just flash a bit before the lobby scene reloads. Any ideas on what's going on?
Some more details: Apparently, the unwanted behavior only happens when the connection fails on its very first attempt. The following scenario causes the error:
Start game
Click join game (make sure no servers would be found)
Wait for timeout
These scenarios, however, will trigger the desired behavior
Start game
Host game
Disconnect
Join Game (make sure no servers would be found)
Wait for timeout
or
Start game
Join game (with an active server present)
Leave lobby
Remove server
Join game
Wait for timeout
Your answer
![](https://koobas.hobune.stream/wayback/20220612043008im_/https://answers.unity.com/themes/thub/images/avi.jpg)