Search Unity

Load Another Online Scene

Discussion in 'Multiplayer' started by Deleted User, Jul 1, 2015.

  1. Deleted User

    Deleted User

    Guest

    Where is a good place to call NetworkManager.ServerChangeScene? I know it needs to be called on the server - would a Command be best?
     
    Last edited by a moderator: Jul 2, 2015
  2. Deleted User

    Deleted User

    Guest

    It's a simple part of Unity's new networking, but I'm figuring it out. I went with a Command in a NetworkBehaviour on an object with a NetworkIdentity. I just call the command from the same script.

    Code (CSharp):
    1. [Command]
    2. void CmdLoadLevel (string sceneName) {
    3.  
    4.     NetworkManager.singleton.ServerChangeScene (sceneName);
    5.  
    6. }