How to Create and Join Sessions in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine 5 tutorial today I can show you how to create and join sessions for your multiplayer games it's gonna be a very easy to follow so let's get started alright yes first of all I want to mention that this will only work locally so it will be basically like online and it's because we're gonna be using default subsystem or from real engine which doesn't provide any host things in in a let's say an external server so basically this will only work in lab uh with what I said let's now actually get started so first of all we will need to create a basically like a main menu team so let's go up here new level has gone to basic say great so this is going to be our main menu uh so let's go ahead and just create a new user interface so right click use interface widget blueprint to let me know use of widget they will be underscore and then I'm gonna say like uh sessions hosting or sessions there will be sessions we can say for example right uh of course if you already have your main menu created or something like that you can open up that scene and then create a new widget phrase so we're going to do is go in the palette and add a canvas panel and then we're going to do is go and add a vertical box so we'll be able to place different buttons over here and it will automatically basically like align I'm gonna be putting this at the center the position on X and Y are the center then in the alignment I'm going to put 0.5 and 0.5 and this is just so everything is centered I'm gonna then go ahead and increase it with the size X and Y 'all and let's make it sound like this okay kind of a bit better uh so now what we can do is to drag our button inside you can see it will be as a child and then we can just get the text and put it inside that button as you can see in the hierarchy it's putting itself in this inside basically so this first button will be for the whole session so host session and then we will do is change the button name to host button and then we're going to do is make sure it's variable now let's go ahead and just duplicate this so Ctrl D and this will be the join button so rename that and then inside the text just change that into join session great so with all that I said we can select the join button and we get some padding on the top so for example 10 or whatsoever doesn't matter and of course this widget is just you know quickly made of course you want to design it like you want add a more detail you can it's just uh the functionality of course great so now we're going to do is select the host session button go down into the unclicked event we're going to add over here the event so now when we click this button we can start doing things so I'm just going to go and delete all the stuff we'll need there so what we're going to do here is basically create a session so go ahead and it's fine uh create session and repair controller where we get if I know how to type get player controller and then add public connections is basically the amount of players that you can have in your session right let's put something as five for example just to have this at default and now in here I know that it says you slam uh it doesn't matter we can just lay like this uh but still don't worry it will not um oh sorry that not don't get excited because if you pass this to your friend in Canada and you're in I don't know in Europe this will not work okay uh so you just have that in mind hey once we have successfully created this session we have to basically go into the other level so just add a open level node and you have to put exactly the name of the level what I recommend is going and copy this has to be exactly how it is okay in my case I have a lot of junk over here I know uh but it should be in here third person Maps and here it is third person Maps let me copy the name and put over here and paste it make sure there's no spacing uh after before whatever and now we will have to just expand this and we have to go into options and I have to type over here is a um the symbol how do you say in English the questioning symbol and then you have to write listen like this all together press press enter and that's it uh the L in lower case okay and great uh question mark was the the same one didn't remember for some reason so this will be basically pause session and now we have to go into the join session so I'm here in join button selected go into clicked I'm going to do the similar thing what I'm going to do is say find sessions once again copy the player controller paste it here so now this will basically go through all these sessions uh and basically find them all so you can say that this will give us an array for example first of all let's put the Max results to like a hundred okay this the max sessions that you can find this is up to you I mean not the less the faster of work and things like that good idea uh so a basically this will return a resource array because I mean it's a list of sessions if you don't know what an array is basically a list of objects in this case a list of sessions so we do is do a for each Loop and then and we can basically so it will run through all the array all these sessions and then for example we could display and create buttons and then you can choose whatever session you like and join but for making simple for this tutorial we're going to do is just get a copy copy and uh get the first copy with this zero and then from this we're going to do this join session on success okay and just to make things a bit simpler if you want to make a server uh let's say browser um of all the games and servers like for example in rostone in Ark survival evolved something like that let me know in the comments below and so we'll be basically join this session great so with that we should be able to do this now you're probably questionable first of all we have to place the play control here again you're probably questioning well we don't need to do anything more here no we don't have to open the level automatically when you join a session it will join the map uh level that that session is being hosted so that's great because for example if the person is hosting a custom map and you'll be able to join that custom maps so you have to know and basically manually type that in so that's great um we can put some prints in so for example in here and we can put a print of session created which will not be a label to see us in a second because I mean it will load up very quickly the map but whatever and then here say a session found all right session found and then another print on success here on um session joined session joint okay great so now we have pretty much all the functionality to join and host sessions so now we have to do is compound save go to our main menu level and go ahead and open the level blueprint so basically in the begin play what we'll do is basically create the widget so create widget I know how to type here we go and uh the class will be WB sessions basically the one that we have just created only in player we get player controller and then the return value we can just add it into the viewport so we'll be in the player screen there we go so now if we press play you can set we have the options stop but in order to test this we have to do is open to instances to Windows basically and so we can do is click on this uh change play mode and play settings and we go down we can change the number of players to B2 of course you can test it with the amount to play so you want but let's say is two and then in that mode we're going to just leave it as Standalone because this is basically single player and this hosting a server and being used to client but we can just leave it as whatever it is for example single player because when we host or join it will actually detect which one is this and assign it so we just can leave that as tunnel for example you know printable and we're going to say new editor windows so it will open up to Windows so what we're going to do is with the white one I'm gonna say host session so let me click it and there we go session created I'm here in the gate what is happening to the character's hair I have you seen that was there okay uh let's go now to the left one and I say join session once we click it you may not see the name immediate response that's why it takes a long time to find the session but you can see session five session done there we go here going ahead and working as it is so yeah maybe it doesn't appear instantly okay but don't worry it might be working just it takes a couple of seconds now a quick thing I'm gonna mention is that make sure that in your map you have two player response what it does here is you select this one and duplicate it so Ctrl D is more because if not um your character might spawn in a series so it will fall down so just have that in mind but that's a part thing from this session and stuff anyway if you plan to tell helpful or group shake like the video and subscribe to my channel I have lots of Unreal Engine fan stories so if you want to check them out go ahead do my this one server and follow me on my searches without said bye bye thank you foreign [Music]
Info
Channel: Gorka Games
Views: 24,760
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, join create sessions, tutorial, quixel, megascans, unreal engine join session, create sessions unreal engine 5, ue5 join create rooms, ue5 join rooms online tutorial, ue5 how to join create online sessions, unreal engine 5 simple online rooms, unreal engine 5 easy rooms, unreal engine 5 multiplayer sessions, unreal engine 5 how to make multiplayer sessions, unreal engine 4, ue4, unreal engine 5 easy room online tutorial
Id: nSumrYmRH7w
Channel Id: undefined
Length: 9min 44sec (584 seconds)
Published: Wed Apr 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.