Needing some help with displaying player name

Options
Hello,

I am trying to show players names in the lobby. At first, I thought I could simply use PhotonNetwork.playerList but this doesnt seem to have a player Name property. I guess I could set one that way - maybe that would be easier, or maybe there is another method out there?

I guess my question is - where is a good place to store the players name on the server, or do I need to write a custom property for this under PhotonNetwork class? There seems to be a couple name properties but none of them seem to work for showing your name to others or atleast I dont know how to use them, thanks!

Comments

  • Well I am currently solving with a gameObject that is never destroyed and then just sending an RPC to everyone with the player's name. I guess I was just wondering if there is a class in Photon that can store player information on the network so I could simply "upload" my players info like name and level etc, and it would be synched to the network.
  • Tobias
    Options
    Plain and simple: You shouldn't do this.
    We think it's a bad idea to show player names in the lobby and sending them all to anyone in a lobby anytime. It's a lot of traffic and doesn't help a lot.

    You can find friends!
    If you are looking for someone, let the server do the work. You only have to provide a list of userIDs you want looked up and get their room names back. You're instantly able to join those rooms. No lobby needed.

    PUN has a new sample for this, too. It's the last from the text-menu in the demo hub.