change scene in network lobby manager
hello, after having managed to make the network discovery and a lobby for the clients in the network, I am having problems when changing scene, what I want to do is from the scene of the lobby, to run to a loading scene and from there just the scene of the game but I get the prefab game players appear in the game scene, someone can help me.
Answer by BruceKristelijn · Dec 03, 2018 at 03:26 PM
I did this once, Was a huge pain in the *ss to find everything out. Basically the structure I used was like this:
1. Lobby scene as first scene with network lobby players being instanciated.
2. Lobby Players chose class etc and a map to play on.
3. Host starts match after alll isReady syncvars were positive.
4. Loading screen popped up and loading initated on host.
5. After host finished switching scenes the client recieved the command to start loading.
6. When they all completed the loading screen faded away allowing them to play.
This is the theory behind it. Some docs to look into:
https://docs.unity3d.com/ScriptReference/Networking.NetworkManager.ServerChangeScene.html
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager-sceneLoaded.html