Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 darthtelle · Dec 10, 2015 at 04:25 PM · c#networkingmultiplayermultiplayer-networkinglobby

UNET Multiplayer Lobby not creating an instance of the lobby player

I'm trying to create a multiplayer lobby with UNET. I have a game object in my lobby scene with the Network Lobby Manager component attached to it. The Lobby Player variable has a reference to a prefab with a Network Identity and Lobby Player component. I'm wanting to build the GUI from scratch rather than using the Network Manager HUD so I have some buttons such as "Start Host" and "Start Client".

Clicking the "Start Host" button calls "StartHost()" and I get debug telling me that the host has been started and that a server and a client has connected. However I was under the impression after reading through the documentation, that when a client connected (I've tried this locally and not) that the lobby manager instantiates a lobby player automatically for every connected client. Mine doesn't do this.

Setting the log level of the Network Lobby Manager to Debug instead of Info, I get some extra debug that says "Ready with no player object" but I don't know whether that is in relation to something failing and not being able to instantiate a Lobby Player?

Has anyone had a similar situation? Or know of any tutorials or documentation on creating a UNET lobby? I have read all the documentation in the manual (which I find very shallow) and I've also downloaded the Network Lobby and Network Starter sample projects. I can't see any other code they call in order to work and my manager setups are the same. Am I missing a certain call??

Thank you!

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 phineliner · Dec 10, 2015 at 06:04 PM 0
Share

I found this quite usefull, when I started working on lobby: http://forum.unity3d.com/threads/networking-lobby-example-beta-q-a.341592/

(In case you didn't find this example yet) (And yes, the documentation currently is a pain to work with...)

avatar image darthtelle phineliner · Dec 10, 2015 at 07:08 PM 0
Share

Thanks, I have been using that sample. Just trying to step through it bit by bit right now, and it still won't instantiate a Lobby Player in my scene. I can't see if there's any code being called in the project that I'm not calling. So either I am missing a call or my settings aren't set up correctly?!

avatar image phineliner darthtelle · Dec 10, 2015 at 07:10 PM 0
Share

I've had that problem when I was instantiating my Lobby$$anonymous$$anager via script ins$$anonymous$$d of putting it in a scene and loading that scene. $$anonymous$$aybe this is your problem as well?

Show more comments
avatar image webgovernor · Jan 21, 2016 at 05:31 AM 0
Share

I have a similar issue, only that the LobbyPlayer isn't created until I exit and re-open the scene again, sometimes. It's very frustrating.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by glitchers · Jun 17, 2016 at 04:36 PM

I had this issue even with Auto Create Player set to true.

It was because OnServerAddPlayer was exiting the function early because the loaded scene wasn't the scene it expected as the 'lobby' scene. If you look at this function in the source (the HLAPI is all on bitbucket, I highly recommend downloading it) you can see the first thing it checks is if the current scene is the lobby scene it expects.

I had inconsistent behaviour with this as sometimes the scene would load in the editor fine and a lobby player would be created but most of the time it wouldn't work. Additionally as this is the 'desired' behaviour nothing is logged.

For me this is because I was creating/joining a matchmaker game from one screen and loading the lobby scene in the same function. I now use a scene loading system I've made to determine when the scene is fully loaded before trying to start/join the match and the problem is gone.

Hope that helps anyone else who comes across this like I did.

Comment
Add comment · Show 1 · 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 nasoukikos · May 22, 2017 at 02:42 AM 0
Share

Hey! I have the same issue, can you share a bit more what you did to solve the issue? For example how do you deter$$anonymous$$e if the scene was loaded and then try to join? I debugged it and it shows that indeed the scene is the lobby scene so I'm a bit at a loss on this. The weird thing is it plays normally when I connect it with a pc in my region but i get the problem when somebody from another area connects

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

55 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 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 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

Clients can't spawn bullets, but the server does 1 Answer

[UNET] LobbyManager - OnLobbyServerSceneLoadedForPlayer() not executing for clients 1 Answer

Loading spawned prefabs upon connecting to server? 1 Answer

Multiplayer game with multiple level 0 Answers

OnStart ___ vs OnLobbyStart ___ methods from NetworkManager and NetworkLobbyManager 1 Answer


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