Getting started with Facebook Gameroom: Unity 5 Tutorial

Unity 5.6 provides Facebook Gameroom platform build support. With this version of Unity, you can build your games for Facebook gameroom client in unity editor.

This article is a beginner’s guide to build your games in unity editor for Facebook Gameroom.

Steps to build Facebook Gameroom Game in Unity

  • While installing unity 5.6 make sure to check “Facebook Gameroom Build Support”.
    Facebook Gameroom - 1
  • Once you will install the Facebook gameroom build support, it will also install gameroom on your machine. You will get an “Facebook Gameroom” icon on your desktop.
  • You will need app id to test your build on Facebook. But you can test the game in Gameroom application without app id. Follow your steps on given link and generate your app id.
    https://developers.facebook.com/docs/apps/register
  • If you want to upload your game to Facebook hosting then you will also need Access Token. If you want test your game in Facebook Gameroom client only then you can skip this step.
    After generating app id, access your Facebook developer account dashboard from the browser. There you can generate the access token.
  • Let’s create a simple application in unity. I have added a cube in the scene. The color of the cube will be blue at run time. When I will click on the cube then it will start rotating, on next click rotation will stop.
    Facebook Gameroom - 2
  • Attach the below given script to the Cube game object in the scene.
  • Run the application in unity first.
    Result Unity
  • Now, go to the build settings (File -> Build Settings) and switch the platform to Facebook.
    Facebook Gameroom - 3
  • Click on the Player settings and add your app id. I will leave it as “0” as we will only test the build in gameroom client. Also, I am not providing any access token, but to host the app on Facebook, you need to fill this area.
    Facebook Gameroom - 4
  • Now build the application. It will generate an executable file.
  • Open Facebook Gameroom application in your machine. It will ask you to login, provide your Facebook credentials and you will be able to login.
  • Click on your profile icon on top right corner.
    Facebook Gameroom - 5
  • Select [Dev] Debug Local Unity Game Build and load your already built .exe file.
    Facebook Gameroom - 6
  • I have loaded this example build and it worked fine.
    Result Gameroom
  • You can also host your game on Facebook. Once you testing is complete you can go for Facebook hosting. But, you will need an app ID and Access Token. In unity editor, open build settings and check “Package build for uploading”, put comment in front of “Upload last build to Facebook” and build the application. It will upload the game to the Facebook hosting.

Hope you enjoyed reading this tutorial. Post your comments for queries and feedback. Thanks for reading.

Share Button
The following two tabs change content below.
Gyanendu Shekhar is a technology enthusiast. He loves to learn new technologies. His area of interest includes Microsoft technologies, Augmented reality, Virtual reality, unity3d and android development.

Gyanendu Shekhar

Gyanendu Shekhar is a technology enthusiast. He loves to learn new technologies. His area of interest includes Microsoft technologies, Augmented reality, Virtual reality, unity3d and android development.

2 thoughts on “Getting started with Facebook Gameroom: Unity 5 Tutorial

  • October 16, 2017 at 9:25 pm
    Permalink

    Thanks for the tutorial. I have a question. Is there a way to create “Package build” programmatically. Normally when we hit the build button with the “Package build” otion selected, unity creates a .7z file for us to upload. How can we do this on command line?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *