Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Netcode server-side multiple additive scenes

Discussion in 'Netcode for GameObjects' started by WallaceHS, Sep 14, 2022.

  1. WallaceHS

    WallaceHS

    Joined:
    Aug 7, 2021
    Posts:
    9
    Hello friends and teachers!

    I'm trying to develop a multiplayer game where I have multiple scenes preloaded only on the server side. When given user connects, it loads its last map/scene. An analogy would be a galaxy with multiple star systems, where each system is a different map preloaded on the server. Users only know current the map "they are in".

    I am using
    Code (CSharp):
    1. SceneManager.LoadSceneAsync(scene.name, LoadSceneMode.Additive)
    to preload all scenes on server side. The problem with this is that when a client connects it automatically loads all the server-scenes on the client as well.

    Note:

    Before this, i tryed:
    Code (CSharp):
    1. NetworkManager.Singleton.SceneManager.LoadScene (sceneName, LoadSceneMode.Additive)
    But this got me a worst result: even the server side did not work properly

    Please, what is the right way to load only 1 of the server scenes on the client side, using Netcode?

    (Just to clarify, I am not loading anything on client side, all scenes are loaded automatically when client connects)

    Thank you very much!

    Best regards, Wallace
     
    Last edited: Sep 14, 2022
  2. itisMarcii_

    itisMarcii_

    Joined:
    Apr 5, 2022
    Posts:
    107
    Unity doesnt support multiscenes right now, or even in the future. What you need to do to make it work is developing your custom scenemanagement system.
    I know its unconfident to do so, but its sadly the only way right now.