Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by Madswint · Jan 16, 2014 at 02:34 PM · networkingplayermenu

Getting a list of players connected?

I'm trying to make a TAB menu, seeing players lined down along with their player ID, which is first guy connected0, then next 1 and it goes on and on. How would I approach this? I cant find any 'simple' way to do this anywhere, any help is greatly appreciated. Thanks in advance.

Comment
Add comment · Show 7
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 Calum-McManus · Jan 16, 2014 at 02:39 PM 0
Share

The easiest way to do this would be to have all the players with a common tag, then you can check for that tag and use it to get the information from that object? :) If you need scripting help I can only really use C# but I'm happy to help if you need it :)

avatar image Madswint · Jan 16, 2014 at 02:45 PM 0
Share

I can only do Javascript, and not that much of it aswell. I can easily get the tag, but I have no idea how to get any information.

avatar image Calum-McManus · Jan 16, 2014 at 02:49 PM 0
Share

Well if you where to have a script, well what infomation do you need from each player? like a player name?

if so, then if each player has a script containing their information such as a name, you can use "GetComponent" to find that script and use its info!

avatar image Madswint · Jan 16, 2014 at 03:03 PM 0
Share

Hmm yeah, but how would I get their player ID, so I can make a command to disconnect them via player ID? And how exactly would I make the player list? With arrays I guess, but I dont really know how to put stuff like that into an array automaticly.

avatar image Calum-McManus · Jan 16, 2014 at 03:10 PM 0
Share

I'm afraid I can only give you concepts as my skills with JavaScript is very low as I've always used C#. But everything in a game if stored in a script somewhere, so on each player there must be a script containing there network status including there network ID, and using GetComponent you should be able to find use it.

This is why i used photon, it comes with build in commands such as "PhotonNetwork.PlayerList".

As far as adding them to an array, if you have a script set to check for a "player" tag, then using that array.add function you can add all the players to that array.

http://docs.unity3d.com/Documentation/ScriptReference/Array.Add.html

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Help with player variables (prefab/network) 1 Answer

Make an enemy follow a player through network 4 Answers

Send information from one player to another. Unity Multiplayer 2 Answers

GUILayout.TextField doesn't accept inputs 1 Answer

Changing to online sceen in multiplayer 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