#Cannot load scene: Invalid scene name (empty string) and invalid build index -1

7 messages · Page 1 of 1 (latest)

unreal knoll
#

Fishnet Version: FishNetworking.4.2.2R.Pro
Unity Version: 2022.3.26f1
Transport: Tugboat

    [Command]
    private static async UniTask LoadSceneDebug(string sceneName)
    {
        await UniTask.WaitUntil(() => NetworkConditions.IsManagerReady<NetworkSceneManagerFinder, NetworkSceneManager>());
        
        Debug.Log($"Load {sceneName} Scene");
        NetworkSceneManagerFinder.Instance.LoadExistStackedSceneRpc(NetworkSceneManagerFinder.Instance.GetSceneHandleBySceneName(sceneName));
    }

When I call LoadSceneDebug(), I got error on server side "Cannot load scene: Invalid scene name (empty string) and invalid build index -1"

#

it got fixed with this change

        var sld = new SceneLoadData(handle, sceneName) // Add sceneName string to parameter
        {
            Options =
            {
                AllowStacking = true,
                LocalPhysics = LocalPhysicsMode.Physics3D,
            },
            ReplaceScenes = ReplaceOption.All
        };

By the way, shouldn't it be possible to load a scene using only the scene handle number? Why is there an option to pass only the handle as an argument in sceneLoadData()?

mossy fiber
unreal knoll
mossy fiber
#

And last option which should work is using a Scene reference instead

unreal knoll