photon player object

Hi,

I would like to save the position of the player once the player disconnect. First i dont know how to get the player's gameobject, Secondly im not sure this can be done inside "OnPhotonPlayerDisconnected" ?

Thanks

Comments

  • 1. Search for the gameobject that has this view attached -> view.gameObject.transform

    2. Should normally work as the game object is removed after the notification is fired, not before
  • hhm im not totaly sure what u mean. Issnt it not just able to get the gameobject via photonplayer? Is this gameobject still there onpothondisconnect?
  • yes it is. When you get the event calls (OnPhoton XXX etc) then the stuff is still around normally, the clean up happens afterwards.
    Thats required as you might have (and want) player management layers and you need to know which player left to clean up everything related to him and notify all other players with corresponding update instructions potentially