So I am just following the load scene docs here
specifically just this section:
[SerializeField]
private string m_SceneName;
public override void OnNetworkSpawn()
{
if (IsServer && !string.IsNullOrEmpty(m_SceneName))
{
var status = NetworkManager.SceneManager.LoadScene(m_SceneName, LoadSceneMode.Additive);
if (status != SceneEventProgressStatus.Started)
{
Debug.LogWarning($"Failed to load {m_SceneName} " +
$"with a {nameof(SceneEventProgressStatus)}: {status}");
}
}
}
And I tried to implement like this:
using UnityEngine;
using Unity.Netcode;
public class NetworkSceneManager : MonoSingleton<NetworkSceneManager>
{
public void LoadSceneForAllPlayers(string sceneName)
{
print($"Loading Scene {sceneName}");
var status = NetworkManager.Singleton.SceneManager.LoadScene(sceneName, UnityEngine.SceneManagement.LoadSceneMode.Single);
if (status != SceneEventProgressStatus.Started)
{
Debug.LogError($"Failed to load scene {sceneName}: {status}");
return;
}
}
}
private void StartGame()
{
if(!IsHost) return;
startingGame = true;
print("Starting");
//Testing with first level
NetworkSceneManager.Instance.LoadSceneForAllPlayers(GlobalResources.Level1BuildName);
}
However only the host gets brought into the game when this is run, and it doesnt syncronize the other player with the host and bring them all which is the intended functionality. I have active scene scyncronization enabled on my player prefab, and enable scene management is on on the networkmanager.