Call A Method Before Local Player Disconnected
Options
3dasd
✭
Hello everyone,
I have a method which works pretty well when calling somewhere else or calling by ui buttons.
I'm having this issue:
I need to call this method just before when local player disconnected.
If i use "OnPhotonPlayerDisconnected()" it doesn't work properly because it is calling from remote player, not locally.
I also tested "OnLeftRoom()" method but it doesn't even calling.
My method here:
I have a method which works pretty well when calling somewhere else or calling by ui buttons.
I'm having this issue:
I need to call this method just before when local player disconnected.
If i use "OnPhotonPlayerDisconnected()" it doesn't work properly because it is calling from remote player, not locally.
I also tested "OnLeftRoom()" method but it doesn't even calling.
My method here:
public void ReleaseSlot() { Slots[slotIndex] = true; Hashtable updateScore3 = new Hashtable(); updateScore3.Add("teamslot" + slotIndex.ToString(), false); PhotonNetwork.room.SetCustomProperties(updateScore3, null, false); alreadyJoined = false; }
0
Comments
-
What do you attempt to do?
If you want to update scores, when someone leaves, you have to also cover the case when the connection is lost. In that case, someone remaining in the room should update - not the person who dropped.
Means that you likely don't need a "before leaving room" callback but a reaction when someone else left?!0 -
Hi @3dasd,
Thank you for choosing Photon!
I have posted an answered on stackoverflow for the question identical to this one.
Do not ask the same question on multiple channels next time.0 -
Thank you.0