#Scene Sync Issues
1 messages · Page 1 of 1 (latest)
code:
public async void StartHost(int _maxMembers)
{
NetworkManager.Singleton.OnServerStarted += Singleton_OnServerStarted;
NetworkManager.Singleton.StartHost();
GameManager.Instance.myClientId = NetworkManager.Singleton.LocalClientId;
currentLobby = await SteamMatchmaking.CreateLobbyAsync(_maxMembers);
// Make sure players who join late sync their scenes with the host
NetworkManager.Singleton.SceneManager.ActiveSceneSynchronizationEnabled = true;
}
I have the same problem right now.
private void LoadGameScene()
{
this._loadingScreen.SetActive(true);
this._lobbyController._stop = true;
if (NetworkManager.Singleton.IsHost)
{
NetworkManager.Singleton.SceneManager.ActiveSceneSynchronizationEnabled = true;
NetworkManager.Singleton.SceneManager.SetClientSynchronizationMode(LoadSceneMode.Single);
NetworkManager.Singleton.SceneManager.LoadScene(this._gameSceneName, LoadSceneMode.Single);
}
}
Im stuck in this for the past few days but I dont find any tutorial or documentation online on how to load / unload scenes. Even the documentation of the NetworkManager.SceneManager doesent help.
@regal belfry did you find a way?
Hey! My problem was that I had too many network objects on my player prefab and it was having a problem with it. It also had unnecessary things in my default prefab list, so I got rid of those too. Make sure that your network manager has auto scene migration checked as well. You can log that value out on runtime to help check it if you need to
Do you mean "Enable Scene Management" with auto scene migration? Because this is enabled.
And I only have one NetworkObject and that is the player.
The host connects and changes the scene. Just the clients dont change the scene but still connect.
Did your host change the scene before the clients connect? Or are you changing the scene with your clients already connected? Or are you chaning the scene and connecting clients at the same time?
I load the scene before the clients connect.
Then I would double check that all necessary scene objects are spawned in correctly, that they're all in the networked prefabs list, and all have network objects on them correctly. That is what solved my issue. I had network objects on some UI elements (which are attached to the player) and it didn't like it.
I want to load an empty scene.
An empty scene? How are you spawning in your players then?