This repository was archived by the owner on Jul 16, 2020. It is now read-only.
Repository navigation
Getting started
Joanna Lee edited this page May 3, 2017
·
40 revisions
This article explains how to create a Beam interactive game project in Unity. A Beam Interactive game enables viewers to directly control the environment in and around streamers' broadcasts by interacting with the UI controls displayed.
- Download the Beam SDK from the Unity Asset Store.
- In the Import Unity Package dialog, click Import.

- This creates a Beam folder in your Unity project.
- Go to Beam > Prefabs, and drag the BeamManager prefab into your scene.

We recommend making it the first element in your scene.
- Open the Beam menu and select Interactive Studio.
- Create a new project and name it "HelloWorld". Then click Save.

- Click the **Build ** tab at the top.

- Add a new scene called "default". Next, add a new control. Make sure the control type is set to button (this is the default). Use the name "GiveHealth". This is the string you will reference in your game code.

- Drop the button on the grid.
- Click Save.
- Go to the Code tab.

- Copy the Project Version ID to your clipboard.
- Open the Beam menu and select Open Beam Editor.
- Paste the Version ID from step 8 into the Version ID field in the Beam Editor.
- Click the following link from the Code tab to go to the Developer Lab.

- Click the Manage OAuth button to enter the OAuth Clients page.
- Create a new OAuth client with the following information:
- Name: MyOAuthClient
- Website: http://beam.pro
- Hosts: *.beam.pro
- Next, go to Unity and copy and past the OAuth Client ID into the OAuth Client ID field in the Beam Editor.
- Click the Save project information button.
- Create a new GameObject in the hierarchy window.
- Create a new script called HelloBeam.cs.
- Open the script and add the following call to Beam.GoInteractive() to the Start function.
void Start() {
Beam.GoInteractive();
}
Beam.GoInteractive() is the API method to connect to the Beam service. 23. Within the script's Update method, add a call to receive input from the button you've created in step 8.
void Update() {
if (Beam.GetButton("GiveHealth")) {
Debug.Log("Player health increased.");
}
}
- Click on the Play button in the Unity editor.
- Follow the instructions and enter the displayed code at http://beam.pro/go.
- Open a web browser and go to your Beam channel, http://beam.pro/.
- Click on the Give Health button.
- If you have the Unity console open, you'll see "Player health increased." printed on the console.