My weapon pickup / drop system is almost working. Each weapon has a photon view set to takeover, when a player picks up a weapon, that player takes over the weapon's photon view and the weapon is set as a child of the player. When the player dies, all of the weapons they were carrying are separated from the player's game object and the player is destroyed (to allow the weapons to remain in the scene).
This works perfectly when a player dies in-game, as everyone receives the RPC for the player's death. But when the player quits the application, leaves the room, disconnects, the game crashes, etc. The death RPC is never called so the player's game object, along with all of the weapons they were carrying are destroyed. I need the weapons to remain in the scene no matter who connects or disconnects.
What I'm trying to figure out is how to call the death RPC as reliably as possible right before the player leaves the room, are there any other fallbacks I can put in place? OnPhotonPlayerDisconnected, and OnLeftRoom don't seem to be much help as they are called after the player has left the room. Any help would be amazing!
This works perfectly when a player dies in-game, as everyone receives the RPC for the player's death. But when the player quits the application, leaves the room, disconnects, the game crashes, etc. The death RPC is never called so the player's game object, along with all of the weapons they were carrying are destroyed. I need the weapons to remain in the scene no matter who connects or disconnects.
What I'm trying to figure out is how to call the death RPC as reliably as possible right before the player leaves the room, are there any other fallbacks I can put in place? OnPhotonPlayerDisconnected, and OnLeftRoom don't seem to be much help as they are called after the player has left the room. Any help would be amazing!