Leave & Quit from a Game Session to a Lobby
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).
Leave & Quit from a Game Session to a Lobby
Flaemnova
2022-07-07 04:38:00
Hi,
I wanted to implement a feature where players can leave the game session (after Runner.StartGame(...)) and return back to the Shared Lobby. This assumes they joined the lobby initially before calling Runner.StartGame(...).
Do I have to shutdown the runner, start the runner and rejoin the lobby manually? From the Application Loop and Karts sample, both disconnect from the game entirely upon leaving the session.
Comments
I am also looking for the answer to this question.
I searched but couldn't find it.
void
Update()
{
if
(Input.GetKeyDown(KeyCode.Escape))
{
PhotonNetwork.DestroyPlayerObjects(PhotonNetwork.player);
PhotonNetwork.LeaveRoom();
PhotonNetwork.LoadLevel(0);
}
}
@Hunel
For now I've just
shutdown networkRunner
create new networkRunner
re-enter lobby with new networkRunner
MHG_Developer
2023-02-16 18:35:27
@Flaemnova Had same question. I find the examples a bit confusing as they all seem to be switching scenes constantly when connecting to parts of Fusion: lobby, staging, gameover, etc. I gather this is just showing off how Fusion is scene agnostic? And doesn't loose the session in between loads? I don't know, but it's not how I am used to working the problem in Unity.
The Fusion Application Loop example in the Technical Examples is the one I found that simply shows the whole game loop from connect to disconnect.
Fusion Application Loop | Photon Engine
Back to top