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! Your search result can be found below. Plus, we offer support via these channels:
Try Our
Documentation
Please check if you can find an answer in our extensive documentation.
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).
How to identify player sending RaiseEvent - OnEvent
denmla1000
2019-10-01 07:35:47
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
Comments
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)
.
denmla1000
2019-10-02 08:44:53
Thanks.
You mean Photon.Pun.PhotonNetwork.CurrentRoom.GetPlayer(int) or some other Room?
Yes.
Photon.Pun.PhotonNetwork.CurrentRoom.GetPlayer(int)