Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted Scene management in MLAPI

Discussion in 'Multiplayer' started by Lazy_Evaluation, May 3, 2021 at 7:21 PM.

  1. Lazy_Evaluation


    Nov 16, 2019
    Hello guys! I'm beginning to learn MLAPI, from documentation and youtube tutorials.
    I'm confused about scene management. I know that there's a network switch scene method to switch scene between all clients, but how do I switch scene in a single client?
    Let's say, for example, that my multiplayer game has three levels, each in in own scene, and a door connects the scenes. In singleplayer, I would change scene via SceneManager.LoadScene. But how do I do it with MLAPI? I guess I have to change scene and spawn the other players prefab that are in this scene.

    Second question, this should be easier: how do I change scene after connecting/beginning the host process? I need to switch from my menu to my game scene.
    Thanks guys <3
  2. cosminunity


    Unity Technologies

    Mar 4, 2021
    Hi @Lazy_Evaluation,

    To switch the scene on a client, you would normally need to use the SceneManager API of Unity, I think a great reference to look at for doing what you are looking for is one of our Bitesize Samples called Invaders which features a Lobby + join in progress and more, by having a trivial Finite State Machine that handles the scene that you are in.

    For more information, please check out our DOCS here and the GitHub Repo for Invaders and other Bitesize samples

    Let me know if this helps you!

    With that being said more updates will come to MLAPI around SceneManagement so stay tuned! And not to worry, we will update our Docs and Samples to reflect those changes!