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

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!

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.

I see. Thanks!

1 Like