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

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How i get my UserId or a player UserId?

2016-02-14 18:01:49

I used Custom Authentication. How i get my UserId retrieved from auth server? How i get UserId from PhotonPlayer of other player in the room (for example to add it to my friends)?


2016-02-15 07:37:39

Getting UserId of other actors is not possible right now.
PublishUserId option was added to RoomOptions for this purpose. I don't know if PUN has it already or not.
The solution is to send UserId as room or player property if you want to exchange it with others.

2016-02-15 12:03:30

@JohnTube thanks. PUN doesn't support PublishUserId. so i use custom properties. what about getting own UserId? if can get by PhotonNetwork.AuthValues.UserId after connect to photon?

2016-02-15 13:00:17

Let's keep that discussion on the other thread.

2016-08-18 07:50:31

Is there any update on whether the real UserId of other actors is or will be readable in the future? It seems to me that relying on the client to explicitly send userId as a player property is not secure, and could lead to impersonation etc.

2016-08-18 11:11:04

Hi @sosh,

Please take a look at RoomOptions.PublishUserId.

Back to top