Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved Loading screen with Netcode for GameObjects

Discussion in 'Netcode for GameObjects' started by Djoxon, Sep 5, 2023.

  1. Djoxon

    Djoxon

    Joined:
    Apr 22, 2023
    Posts:
    4
    Does anyone know how I can make a loading screen that's shown between scenes using Netcode for GameObjects?
    Currently this is my code for loading a new scene:
    Code (CSharp):
    1.  NetworkManager.SceneManager.LoadScene(SceneName, LoadSceneMode.Single);
    From what I've seen when creating a loading screen SceneManager.LoadSceneAsync is the function used, but there is no such function in netcode.
    Is it possible to make a loading screen with netcode, if so how can I do it?
     
  2. BSimonSweet

    BSimonSweet

    Joined:
    Aug 17, 2022
    Posts:
    67
    I think it's better if you handle UI thing only on client, the server doesn't need a loading screen.

    The client can receive event when the server load a scene. You can register a callback and handle your loading screen that way.

    https://docs-multiplayer.unity3d.com/netcode/1.5.2/basics/scenemanagement/scene-events/
    https://docs.unity3d.com/Packages/c...Unity.Netcode.NetworkSceneManager.html#events

    On your server, you just load your scene or whatever that take time to load, you don't need to hide it.