Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Third Party [PUN2/VR] Going from room-scene to room-scene

Discussion in 'Multiplayer' started by PascalTheDog, Mar 9, 2022.

  1. PascalTheDog

    PascalTheDog

    Joined:
    Mar 16, 2015
    Posts:
    86
    Hey,

    I'm working on a VR multiplayer game with a three-scene flow: the starting chamber, the collective lounge and the play arena. The latter two are associated with their own rooms.

    The starting chamber scene is not multiplayer: it deals purely with player preparation and calibration; from then on, their avatar remains persistent across rooms-scenes. When all's done, it connects to the server and loads the collective lounge room and the associated scene. In here, players can see each other and make decisions about how they're going to play. Once everyone is ready, it loads the player arena and the associated scene. At least that's how it goes in my mind. Of course, some player can join later and find themself alone in the lounge, from which they can join the ongoing match in the play arena if they so wish.

    The way Photon PUN is designed, you can't hop from room to room; you need to be on the master server to create or join a room. So what I do when I want to switch room-scene is leave the current room, then use callbacks to load the next room and the associated scene when I'm back on the master server. Well, that's what I'm trying to achieve right now.

    Is this good practice? Or am I missing an essential piece of the puzzle? Assistance would be greatly appreciated. Cheers!
     
    Last edited: Mar 9, 2022
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    You could also use Interest Groups to separate the two areas within the same room. This would not fully separate them though and the lounge would be per-room.
    If you wanted the lounge to be another room entirely then use the approach you described: Leave lounge and JoinOrCreateRoom on the Master Server to get into a separate room/game.
     
  3. PascalTheDog

    PascalTheDog

    Joined:
    Mar 16, 2015
    Posts:
    86
    I see. Thanks!
     
    tobiass likes this.