Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Is there a way to load different scenes between clients in a multiplayer game?

Discussion in 'Netcode for GameObjects' started by Sushi8819, Oct 20, 2023.

  1. Sushi8819

    Sushi8819

    Joined:
    Oct 20, 2023
    Posts:
    17
    Hi.
    I've recently started creating online games with Unity. So, I apologize if there are any fundamental misunderstandings.

    Currently, I'm developing a multiplayer game that runs on a cloud-based dedicated server with NGO.
    Clients access the server using WebGL.
    While I've confirmed it works fine in the cloud, I'd like to create a game launch screen (with options and a start button) to enhance the gaming experience.
    From my online research, it seems that clients can't display scenes other than what the server is running.
    In the case of a Windows application, you could switch scenes before connecting to the server, but I want to achieve this behavior with WebGL.
    If switching scenes isn't possible, are there any alternative methods available?

    Thank you in advance.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,979
    There is nothing about WebGL that forces you to set this up in a different manner than for a desktop application.

    You can implement a custom Scene Manager (see NGO manual). But this may prove tricky or complex, or both.

    If all you really need is a launch screen, and that screen is an offline screen from which the client connects to the server, there's not really anything you need to do. Once the client connects, the client will automatically load the server's scene.

    If you need a client to be able to go back to the launch screen, or any other GUI screen for that matter, while remaining connected to the server, it doesn't mean that you have to change scenes to bring up that GUI.
    A fullscreen (or overlay) canvas, displayed only to the local player, would suffice. The player would remain connected to the server and participate in the game session, even though that player is temporarily unresponsive from the perspective of other clients.

    I'm sure you can quickly think of a multiplayer game where a player appears unresponsive but is in fact just going through the game's settings screen for a moment in order to adjust graphics detail or audio volume or configure controls or whatever.
     
    Sushi8819 likes this.
  3. Sushi8819

    Sushi8819

    Joined:
    Oct 20, 2023
    Posts:
    17
    Thank you for the response.
    My mind was preoccupied with changing scenes, and I hadn't thought about the idea of displaying it from the top with a canvas.
    Now I've grasped a rough concept, and I'll do further research.
    Thank you very much!