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.

Unique ID

2018-11-24 14:30:57

How can i give all the players a unique id like 1,2 or 3 etc.?


[Deleted User]
2018-12-04 16:19:25

Hi @ruse,

when in a room, a client has a unique number: the Actor Number. You can access it on the local player by using PhotonNetwork.LocalPlayer.ActorNumber.

2018-12-06 16:06:20

Hi @ruse,

Thank you for choosing Photon!

You could also try "PlayerNumbering" component if you do not want ActorNumber to go beyond MaxPlayers and recycle/rotate/reuse the numbers if you allow players leaving and others joining instead.

Back to top