How to identify player sending RaiseEvent - OnEvent

Player sends RaiseEvent to all players.
How to know who sent this through OnEvent(EventData)?
I can send LocalPlayer object via eventContent but i guess there is a simpler way

Best Answer

Answers

  • Hi @denmla1000,

    Use EventData.Sender.
    If it's 0 then it's the server.
    If it's not 0 then it is an actor number. Get the player by its actor number using Room.GetPlayer(int).
  • Thanks.
    You mean Photon.Pun.PhotonNetwork.CurrentRoom.GetPlayer(int) or some other Room?
Sign In or Register to comment.