Making a MULTIPLAYER Game? Join your Players with LOBBY!

preview_player
Показать описание
👍 Learn to make awesome games step-by-step from start to finish.
👇 Click on Show More

🔴 RELATED VIDEOS 🔴

💬 Let's learn how to use Unity Lobby to connect our players together before starting the game.
You can create a new Lobby, make it public or private, then players can find it either through a Lobby browser or by inputting a Lobby code.
You can then define whatever data you want for the Lobby and each Player. Things like Game Mode, Map, Teams or for the Player you can have Selected Character, Loadout, Color, etc.
This is a really easy to use tool that you can add to your Multiplayer games to make it easy for players to find one another.
This also easily integrates with Netcode for Game Objects which I've already covered, and Relay which I will cover in the next video.

📝 Some Links are Affiliate links which means it costs the same to you and I get a nice commission.
🌍 Get Code Monkey on Steam!
👍 Interactive Tutorials, Complete Games and More!

If you have any questions post them in the comments and I'll do my best to answer them.

See you next time!

#unitytutorial #unity3d #gamedev

--------------------------------------------------------------------
Hello and Welcome!
I'm your Code Monkey and here you will learn everything about Game Development in Unity using C#.

I've been developing games for several years with 8 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.

I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.

--------------------------------------------------------------------
- Other great Unity channels:
--------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

💬 This was one of the most requested UGS tutorials, I hope you find it useful! Best of luck with your Multiplayer games!
👍 Learn to make awesome games step-by-step from start to finish.

🔴 RELATED VIDEOS 🔴

CodeMonkeyUnity
Автор

I found myself returning to this video often to refresh my memory when building my lobby I wrote down all the time stamps to the sections maybe some one can also use these...
1:54 install packages
2:06 setup services
3:08 script creation / service initialization
5:46 create lobby
8:18 search for lobbies
11:17 implement lobby heartbeat
13:22 add filters to search for lobby
16:55 join lobby by id
18:48 creating lobby options
20:12 join lobby by code
21:16 quick join lobby
23:48 print players
28:06 player creation refactoring
32:33 update game mode
37:30 handle update polling
39:56 updating player names
41:34 leaving lobbies
42:40 kicking players
44:40 transfer host
46:02 deleting lobbies

coryscustominstalls
Автор

Hey anyone confused on async and await well let me explain async will run freely by its self and await will not continue the code until the line its used on has been excecuted if i got something wrong reply since i just researched it and im also confused but i tried my best

treeadam
Автор

Yall, just a tip don't name your script "Lobby" since its a keyword it will give you head aches... :D

sir.niklas
Автор

If like me you're a newbie and get the error : "player is already a member of the lobby" while trying to join a lobby from different instances of the game, you have to find a way to differentiate the two players (host and client). One way is to change your authentication method like this :

private async void Start()
{
var options = new InitializationOptions();
options.SetProfile("Player" + Random.Range(0, 1000));

await // Randomize this using the two lines above


zanuka
Автор

Was going to sleep, code monkey's notification came, so I am here ... Postponed sleep for next 52 minutes 😁

akash_the_phenomenal
Автор

As someone who's been working with Unity professionally, you never cease to give really great reference to new services and quick implementation, keep up the hard work!

eze-cs
Автор

Just a note in case some is facing the same issue. If you are using the editor to test (I am using parrellels sync package), the heartbeat might stop when you unfocus the editor window. You can change it in Edit -> Project Settings -> Player -> Resolution and Presentation -> Run In Background. Also the anonymous login will create the same id for both players when logging in by default. You can either clear the session tokens or use different profiles to get around it.

ezrahuffman
Автор

Could you possibly make a tutorial on how to make the UI for the lobby and how to connect it to this? I've followed this tutorial but I'm not quite sure how to do that. The main problem I'm having is I'm not quite sure how to get the names of the players in the lobby, but I see you set it up to do that in your UI.
Regardless, thank you for making these tutorials for us!

AntAptive
Автор

I would love some insight in Steam intergration with Unity Multiplayer Networking

MrMrn
Автор

Really appreciate this detailed explanation 👍

durvesh
Автор

I just started game developing and it seems like all my ideas that I am excited about are all multiplayer, seems like I timed my start right, thank you for these valuable videos!

SzaboB
Автор

I have returned to this video approximately 20 times over the last three weeks. It is amazing, giving only what we need and no confusion. I'm actually using what I learn to develop a unity package that incorporates everything here with steam, automatically setting player icons and names and such. Thank you very much for this tutorial, it would have taken me months without

TheAsbjrn
Автор

i am getting this error while setting up the lobby system

Error CS0029 Cannot implicitly convert type to 'Lobby'

muerrtee
Автор

Awesome. 👍🏻😁
You made it look easy... which is the Best a Teacher can do.

I will try it on my future Prototype.

Thank you for making this video. 😄✌🏻

alec_almartson
Автор

I know this is so dumb, but at 29:15 one of the randomly generated player IDs contains the word "fART" lmao

marcusfanning
Автор

Make a tutorial for netcode using Steamworks p2p also plz.

lavimahal
Автор

My question is, I managed to connect, how can I switch to the game scene and how can I host it in the lobby via netcode? Or is it automatic?

linkrider
Автор

Awesome video. I have come back to this several times while prototyping my own lobbies implementation. Would be super helpful if you included chapters!

evanstaylordigital
Автор

How to add search bar so that many players playing the game have option to search the name of any player and add him as a friend instead of lobby

LegendaryCombatForce