Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Michael_-01-_ · Aug 03, 2015 at 05:28 PM · guipun

Photon unity networking, all players in lobby

enter code hereHi guys, so I have this problem, I want to display all players in the lobby, but for some reason I can not get my code to work :( can anyone please help, I am sure I'm making a very stupid mistake. Here is my code

 foreach( PhotonPlayer Pplayers in PhotonNetwork.playerList)
 {
    GUILayout.Label(Pplayers.name);
 }

For some reason it just does not want to work???

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Michael_-01-_ · Aug 05, 2015 at 03:50 PM 0
Share

Sorry guys xx it was something stupid. I did not assign the player's PhotonNetwork.player.name, all fixed :))

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tobiass · Aug 05, 2015 at 08:45 AM

The PhotonNetwork.playerList is only available while in a room, not in the lobby (now better described in the API reference).

The clients don't get a list of players looking for a game. This could be thousands potentially, which is too much to list (and too much to digest as user!).

In a lobby, you can get the count of users looking for games: PhotonNetwork.countOfPlayersOnMaster. You can also show how many games there are: PhotonNetwork.countOfRooms (even without entering the lobby, which gets you the rooms list).

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BadSeedProductions · Jan 05, 2016 at 03:21 PM 0
Share

Poor excuse for lack of functionality. Took me 5 hours to stumble upon this answer, maybe should be documented. I am glad we can at least get a player count though, I will just print out my player list with generic names such as "player9999" which stinks but hey, since exitgames thought it was a great idea to skip work this day, it will have to do. @tobiass - "and too much to digest as user!" seriously you don't know what information our users want, need, or can 'digest' so how about more functionality and less fascism?

avatar image IAMBATMAN BadSeedProductions · Dec 29, 2016 at 01:11 AM 0
Share

@BadSeedProductions listing thousands and thousands of games would be stupid. How slow would that be? It would be a waste of resources if they did add that.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Score display not working 1 Answer

4.6 Gui anchoring a ui element to a Game Object 2 Answers

How to dynamically change the text in Unity(Augmented Reality + NYARtoolkit(C#)) ? 0 Answers

How To Make A Floating Health Bar 1 Answer

Combine alpha of GUI style texture with icon texture 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges