How To Change Sessions / Rooms?
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Fusion.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
How To Change Sessions / Rooms?
GlowstickDave
2022-08-23 19:00:33
We're working on a project with Photon Fusion, and a part of the project is we need to be able to change the Session the player is in, as we have worlds and each world is broken into individual Sessions / Rooms. We can join these sessions just fine, but are having a hard time figuring out how to change to another room.
Essentially what I need is something like this:
await networkRunner.StartGame(firstSessionName);
await networkRunner.StopGame();
await networkRunner.StartGame(secondSessionName);
Obviously we wouldn't join then immediately leave for another room, but just want to be able to leave anytime to join another room. Thanks in advance!
Comments
Is something not working if you do the above?
Isaac_Augusto
2022-08-24 12:02:46
Hi,
That should be doable, but remember to put some delay between the Shutdown
and the StartGame
.
Also, NetworkRunners
are not meant to be reusable, you should create another one for starting the new session.
FYI: It's possible to be on more than one session at the same time, you just need to manage that carefully.
Isaac Augusto
Photon Fusion Team
GlowstickDave
2022-08-25 16:51:32
Isaac_Augusto 2022-08-24T12:02:46+00:00
Hi,
That should be doable, but remember to put some delay between the
Shutdown
and theStartGame
.Also,
NetworkRunners
are not meant to be reusable, you should create another one for starting the new session.FYI: It's possible to be on more than one session at the same time, you just need to manage that carefully.
-----
Isaac Augusto
Photon Fusion Team
This did it - thank you Isaac! (For the Photon Fusion devs - this is something that is lacking from your documentation - I scoured it for two days and found nothing. Please add this to your documentation as changing rooms is kind of important!! Thank you! :D)
Back to top