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

Change Level over Network, Whats the corretct way?

Discussion in 'Multiplayer' started by icehaku, Jan 8, 2015.

  1. icehaku

    icehaku

    Joined:
    Jan 8, 2015
    Posts:
    4
    Hi, I'm trying to learn unity rpc calls to a simple multiplay game.

    [Detailed]:
    > I made a second scene(level);
    >The server changed the scene before client connect;
    >>>> When client join the server he connect in first scene because he don't got the change scene call.
    Made a LOBBY Layer before the "Real Game";
    >Wait people connect to server;
    >Did a change level via RPC call;
    Its ok, it change the level to everyone, BUT?
    ..
    If someone join the lobby after the "change the stage rpc call", he still don't got the level;
    What Should I Do?
    -How I pass the level to client when he joins my server?
    -When I say him and find a solution to the client change the scene when he joins the server, his "scene2" will be our same "scene 2"?
    I mean, a "spawn object call" will create this object in the same view?

    [tldr]:
    I would like to know the correct way to change level over network so people who joins my server after a change level, change to the correct scene and interact with its objects.
     
  2. leizzer

    leizzer

    Joined:
    Jun 26, 2013
    Posts:
    39
    Have you tried sending the RPCs as buffered?
     
  3. icehaku

    icehaku

    Joined:
    Jan 8, 2015
    Posts:
    4
    Hi Leizzer, I didn't know RPC Buffered Calls, I'll try it, thanks!
     
  4. icehaku

    icehaku

    Joined:
    Jan 8, 2015
    Posts:
    4
    It worked!
    I was using the RPC.All before.
    Sorry for late reply and thanks for your help, I solved the problem using the Buffered RPC Calls.
    I change the level using a RPC Called "ChangeLevel", so, when a new player joins the network, he will sync the level.
    BUT, in my case I made a "lobby state", before the real game begins, so I don't have to keep syncing every other object, since nobody will joins after the game start.