5
\$\begingroup\$

I am currently working on the lobby for my game. I have followed these tutorials (https://www.youtube.com/watch?v=jklWlm5v21k), which were very helpful, and was able to setup my lobby like this.

The tutorial explains all about player specific settings using lobby player prefabs, but it does not explain general level settings. I want to be able to select a game type (sudden death, flag match etc), and maybe also a map type.

What would be a good way to do this, and sync it back into the game?

One solution I thought of was adding this to the lobby player prefab, and then only make it editable for the host, and only display the hosts settings for this. Then make the hook change the map/gametype accordingly.

This doesn't quite feel like the right way to do this, so I would be happy to get some pointers on this.

I am using Unity 5.3.5 with c#

\$\endgroup\$
0
\$\begingroup\$

In the lobby manager, add a new panel (or change an existing panel, whichever is easier to you) which contains all the general game settings that you need. When a player hosts a new game, then display this new panel and get all the information, and then start a new game accordingly. Hope this helps

\$\endgroup\$
  • 1
    \$\begingroup\$ How to sync it between all clients? Can I make it behave as a normal network gameobject like in a normal game or something? \$\endgroup\$ – Jasper Jul 13 '16 at 11:20
  • \$\begingroup\$ And how do I communicate the information between the lobby to the game when the game starts? \$\endgroup\$ – Jasper Jul 13 '16 at 11:20
  • 1
    \$\begingroup\$ One way to communicate the information is to create a new game object in your lobby scene and set the DontDestroyOnLoad() for it. Keep all the game setting related information in this object. When the game scene loads, then you can use the information in this object to set up your game. \$\endgroup\$ – greenPadawan Jul 14 '16 at 7:51
  • 1
    \$\begingroup\$ That is actually something I did not think of yet, and a pretty good solution! Thank you! \$\endgroup\$ – Jasper Jul 15 '16 at 8:51
  • \$\begingroup\$ This does not work in practice. How can I communicate the information to the other players (clients)? I cannot spawn the object in lobby mode, can I? \$\endgroup\$ – Jasper Aug 2 '16 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.