Hello,
I am using netcode for gameobjects to create a fps multiplayer game.
Game starts with a Lobby scene, when players are ready the host starts the game using relay.
I want to change the scene from lobby scene to the game scene. I am using
NetworkManager.SceneManager.LoadScene()
method to change the scene.
Then I subscribe the event
NetworkManager.SceneManager.OnLoadEventCompleted
to spawn players when game scene is loaded.
The problem is sometimes the player is not getting spawned. My understanding is it gets spawned in the previous scene (kind of). Sometimes it spawns correct but Unity throws error about the object (player) getting destroyed.
I read the documentations (and asked chat GPT, awful responses) still couldn’t figure it out.
Any help would be appreciated.