Possible to carry Network to a new Scene?

Hi, I’ve long used Photon for my Multiplayer Test Games but I’ve decided that I want to use Unity’s inbuilt, it’s pretty much similar so I haven’t had much trouble but I’ve came to a halt it seems.

The first Scene I have is the menu system, this handles the main menu, starting a server, connecting to a server. Which all works, you can see in the GameView using Stats that players are connecting, to test with I’ve bypassed the Room Menu where players will check when ready etc.

So once a player is Joined they then load the Game Scene, a very basic map with only Spawn Points in. But it seems when I start the ServerClient I spawn in as I want, then if I load a second Game up and connect, I’m listed as in the game in the Stats but in-game it’s as if neither players can see each other. I don’t even get a second Player prefab in the ServerClients inspector.

Am I restricted to only one Scene? Or is it possible to Spawn players on a Network after switching Scenes?

DontDestroyOnLoad, check it out.

DontDestroyOnLoad will not help in this matter. All of the buffered RPC calls and instantiates will happen when you connect to the server. You don’t want a DontDestroyOnLoad on all of these objects.

However, one solution would be to use LoadLevelAsync. You can place all the objects in the scene in a single object in the hierarchy and then disable it or destroy it if you no longer want them.

Another solution would be to use a different networking solution that allows you to control how you spawn and buffer objects like Forge. (Shameless plug after providing an answer for the current implementation XD)

Let me know if you would like further help on this issue using the built in Unity Networking, I used it for quite some time before writing my own solution.

1 Like

Yeah DontDestroyOnLoad does not work,at the moment I’m away but ill look into those Farrisarts.