OK, so we can now connect to our server and to our lobby, the next thing we need to do is allow ourselves
to be able to create rooms for our players to play in.
So at the moment when we connect to the server, there is no rooms available because nobody's playing.
Nobody's trying to get a match going.
So what we're going to do is in our system here, I'm going to get my loading panel and I'm going to
duplicate this for the moment.
I'm going to rename it to be the Create Room panel.
And that's open this up switch to these so we can see it all like so and then I'm going to remove this
loading text and what I'm going to do is right click add a UI input field text mesh pro.
I'm going to rename this to be the room name input field.
So this is where we're going to name the actual room that we have.
I'm going to set the weight of this to be eight hundred and height, to be one hundred and then going
to get inside our room.
Then we have two options here.
We have placeholder and we have text.
So placeholder will be what appears to let your players know that, hey, this is an area you should
click in.
So I'm going to write in here, enter room name here.
That address I'm going to Odyssey's this to a maximum of sixty and we're going to capitalize.
That's not italicize.
We will italicize it.
And then we have our text here.
Let's just center this as well in both directions.
And then on the text component, we're going to send the same thing.
Santarus, a maximum size of sixty.
But we leave this blank because this will only be filled in when our players actually click on it and
types of it.
So just as an example, this is going to play here.
And you can click on this and type in whatever you want.
OK, so let's just stop that.
We make this work in a moment.
Now we have our input area for typing in the name of our room that we want to create.
Then we obviously need a button to click to create the room.
So let's just go into our prefabs and UI.
I'm going to drag our button into here like so and we're going to call this to create room button and
we're going to drag this down to here.
OK, so that's all we need right here for the moment, what we're then going to do is I'm going to deactivate
this, first of all, and we need references to all these things, the input field and the actual screen
itself, so that we can open it up.
So let's go back to our launch scripts and up the top, we're going to have public.
Game object creates room screen.
And public tempy underscore input field for the room name in input.
So this is going to be where we type in our name.
So now that we've added one more create screen or one more screen that we want to activate or deactivate,
I'm going to add that to my list of closable menus.
So create room screen set active faults whenever we close the screens.
And now, of course, we need a way to actually open this screen.
So down here we're going to add a new function.
I'm actually going to delete this update function because we're not actually going to use the update
at all for our launcher.
But then here I'm going to I'm going to add a public void, just a normal void, open room create.
So this is going to open the room, create screen so we'll close any existing menus and start to create
room screen to be active.
So let's make that happen.
Seductive.
True.
There we go.
I was wondering, I had a red message there for a second.
Let's go back into unity.
Let that compile, and now if I go to my menu canvas and going hung up these things, so we have a great
room screen and our input feels like so.
And then if I go to my menu buttons here and go to create room button.
We created the last so that the button would have a space to do stuff and then to make it actually do
the function we want, which is the open the room creates function that we just made will get the object
that has our launch script on us or menu canvas to get into that slot.
Then if you go to no function here, we can drop this down.
And this is how we can select from any of the components that are on that game, object or menu canvas.
So it has lots of different components.
But anyone we care about is the larger one, because in here we have the open room create function.
So let's select.
That's a now when we play the game.
Jesse, we connect and we had create room and we're here so that we can type in the name of the room
we want to create, but of course at the moment it doesn't do anything.