Despawn orphan players in Fusion shared mode

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.

Despawn orphan players in Fusion shared mode

Christian_Moser
2023-02-22 08:29:37

I am developing a large scale metaverse like platform, therefore I am using shared mode.

My question is, how to correctly despawn disconnected players in shared more? OnPlayerLeft is not supported.

When a player disconnects and rejoins, it ends up with two instances:

  • one fresh spawned

  • one automatically spawned by the Networkrunner (during simulation) with state authority: None.

Any help how to handle the player lifecycle correctly in shared mode is appreciated.

Comments

Christian_Moser
2023-02-23 05:57:22

I found the answer myself. I missed to check this option in the network object: "Destroy when state authority leaves"

Back to top