How to exit from a room so that OnPlayerLeft callback is called on the local client as well?

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

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).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How to exit from a room so that OnPlayerLeft callback is called on the local client as well?

Siddhant
2022-03-23 09:18:16

Currently I've tried Runner.Shutdown as well as destroying all the components accept transform but in both the cases the OnPlayerLeft callback is not being invoked on the local player side (the player that just left)

Comments

ramonmelo
2022-03-31 09:23:51

Hi @Siddhant ,

That is by design, the OnPlayerLeft is invoked only when another player leaves the Game Session.

If you want to deal with the local player disconnecting, you need to do it from either the OnShutdown or the OnDisconnectedFromServer callbacks, depending on which mode you are using.

--

Ramon Melo

Photon Fusion Team

Back to top