How to identify our own player ?

Options
I need to indentify each players because I want to Initialise each Player in a different location. I tried to use the LocalPlayer but when I look into the LocalPlayer, every player has the same UserID, ActorNumber, NickName etc...
I also tried the PlayerNumbering, it doesn't seem to work either. I didn't find any other informations in the documentation.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Steve,

    Thank you for choosing Photon!
    Player.IsLocal
    PhotonView.IsMine
    PhotonNetwork.LocalPlayer
    
    I tried to use the LocalPlayer but when I look into the LocalPlayer, every player has
    Why do you need to look at every player if you have LocalPlayer? LocalPlayer is a single unique player not many.
    every player has the same UserID, ActorNumber
    This is not possible in the same room.

    I think maybe the issue you are having is that you are testing on different clients and clients are joined to different rooms. If it's the case make sure clients are joined to the same room. See "Matchmaking Checklist". If it's not the case then there is something wrong with your code and share your snippet here and what you have tried exactly + PUN version.
  • NaBUru38
    Options
    Before connecting to the Photon servers, set the value of PhotonNetwork.NickName to some random string.

    Once you joined a room, check PhotonNetwork.PlayerList to see which players are in that room.