Setting up a Lobby

I wanted a really simple Lobby Scene where players could press a button and it would register on the screen. When all the controllers had been pressed then the game would start.

Creating a new scene

…and calling it Lobby

Screen Shot 2017-02-27 at 10.55.20.png

Creating UI elements

I created a Canvas, and will put 4 coloured box’s with text in them on the screen.

screen-shot-2017-02-27-at-10-55-28

On the box I added a little script called Press To Start

screen-shot-2017-02-27-at-10-55-49

 

Press To Start Script

When the script is done it looks like this in unity.

  • It has a yes/no to say if it’s good to start (Start)
  • Which UI text the script is linked to (UiText)
  • Which button it is checking for (buttonName)
  • Which player is attached to that controller (playerName)

screen-shot-2017-02-27-at-10-56-19

This script uses the UnityEngine.UI – so that needs to be delcared

I have talked through the other variables above:

  • start
  • uiText
  • buttonName
  • playerName

 

And then I check if there has been an input and then display this through the UI.

…simple!

screen-shot-2017-02-27-at-10-59-09

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s