When I create a server, players can connect to it, but if the server loads a new level, players cannot connect to it. Like the server disconnects when loading a new level.
How can I get the server to remain intact when loading new scenes?
When I create a server, players can connect to it, but if the server loads a new level, players cannot connect to it. Like the server disconnects when loading a new level.
How can I get the server to remain intact when loading new scenes?
You could use the 2.6 feature background loading, even though background loading seems to be bugged for me.
Is there no other way to maintain connections between scenes?
If not, than I might just have to load the level and then set up connections afterwards.
Perhaps if you try to use Application.LoadLevelAdditive()
Would that work?
The problem is most likely that whatever game object is handling the connections is getting destroyed when you load the level. The solution is to call “DontDestroyOnLoad()” on that game object before loading the level.
And that game object would be the script it is called from? That makes sense, thanks for the help, I’m going to try it when I get back to school
It all depends on what you’re doing. I usually have a ‘game controller’ object with a script attached that handles users connecting, disconnecting, etc. When the new level is loaded, that object ( and it’s attached script(s) ) gets destroyed, unless somewhere in that script you call “DontDestroyOnLoad(this)”.
Also look at turning the network message queue on and off while you load levels:
and here:
http://unity3d.com/support/documentation/Components/net-NetworkLevelLoad.html
psx