Important: Your Unity game must use the Mono scripting engine and implement the new Input System to function correctly on our platform.
Unity Input System
Unity render streaming requires the new Input System package. Without it, the game cannot receive input from the browser and you will not be able to interact with the streamed game.
Version 1.11.0 of the PureWeb plugin supports Unity engine 2020 and 2021, and supports the following packages:
- Input System 1.3.0
- WebRTC 2.3.3-preview
Important: Make sure that the project does not have Input System and/or WebRTC package already imported. The correct versions will be installed as dependencies when you install the Unity Plugin.
Install & Enable the PureWeb Plugin
In order to properly stream your game through PureWeb Reality you’ll need to download the latest version of the PureWeb Platform Unity plugin.
Add the PureWeb Platform plugin package to your project through the Unity Package Manager. Under the (+) icon click 'Add package from tarball' and then select the package file you just downloaded.
If you prefer, you can copy the package into your game's Assets directory instead.
After the import process is complete you'll find the PureWeb Platform plugin under the Custom header in the Package Manager window.
Create a PureWebStreaming Game Object
We will create an empty game object and associate the PureWebStreaming script with it.
Create an empty object in your scene.
You can name it anything you like in order to make your objects easier to manage. (Ours is named PlatformPlugin here.)
You can find the PureWebStreaming.cs in the Packages > PureWeb Platform > Runtime folder and attach it to the object we just created by clicking and dragging it to the object.
Alternatively, you can import it by selecting “Add Component” in the object inspector.
With these settings, your game should be able to connect to our platform when it is executed.
There is no strict rule about which object the PureWebStreaming.cs file should be attached to, or where the file should be located. You can still attach it to another existing game object if your project has special requirements, but it is strongly recommended to create a standalone object for the PureWebStreaming.cs file for proper object management.
Once the plugin is properly installed in your project, we need to adjust some settings to ensure it is configured correctly.
Game Input Setup
In order for the game to receive inputs from the browser during streaming, your game must implement the new Input System Package. Otherwise, you will not be able to interact with the streamed game.
Please make sure you have saved your project, or even made a backup before switching your project to the new Input System. Once you switch it to the new Input System Package, the Unity Editor will restart your project in order to enable the new package.
Once you have backed up your project, open the project settings. Under Player > Active Input Handling, select the Input System Package (New) option.
Selecting the "Input Manager (old)", or "Both" options will not work. If you choose one of these, you'll be unable to interact with the streamed game in the browser.
Package Your Project
Package the project and ensure that the output folder structure follows the one below before zipping & uploading it to the console.
We recommend using the default Windows compression tool to zip your game package prior to uploading.
Please do not use spaces in your folder or file names.
Now that your project is configured and packaged you’re ready to:
- Test Streaming Your Project Locally
- Upload and Test Your Project in the Cloud
- Optimize your Unity project for online distribution