Unique ID

The whole answer can be found below.

Please note: 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! And we offer you support through these channels:

Try Our
Documentation

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.

Read More on
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

ruse
2018-11-24 14:30:57

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

Comments

[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.

JohnTube
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