Overview

Important: Your Unity game must use the Mono scripting engine and implement the new Input System to function correctly on our platform.

The current version of the PureWeb Unity plugin has full support for Unity engine 2022 LTS and 2023, and platform support for 2021 LTS, and requires the following packages:

  • Input System 1.6.1
  • WebRTC 3.0.0-pre.7, and
  • version 4.4.0 of the PureWeb SDK

Please see our deprecation policy for more information about full vs. platform support.

Watch a short video of the process:

Preparation

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 our 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. We'll call ours PlatformPlugin.

In the Packages > PureWeb Platform > Runtime folder, find the PureWebStreaming.cs and attach it to the object we just created by dragging it to the our PlatformPlugin object. Alternatively, you can import it by selecting “Add Component” in the object inspector. Either way it should like similar to this:

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.

Package Your Project

Mono Scripting Engine

Ensure that you have the correct scripting engine enabled for your project to work on the PureWeb Reality platform.

Open the project settings window. Under Player > Other Settings > Configuration > Scripting Backend, and make sure that the Mono option is selected.

Unity Input System

Unity render streaming requires the new Input System package.

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.

NOTE: If you need to switch your project to the new Input System, please make sure you have saved and made a backup before doing so! Once you switch it to the new Input System Package, the Unity Editor will restart your project in order to enable the new package.

Open the project settings window. Under Player > Other Settings > Configuration > Active Input Handling, and make sure that the Input System Package (New) option is selected.

NOTE: 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.

Build & Package

Package the project for Windows, and ensure that the output folder structure follows the one below before zipping & uploading it to the PureWeb 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.

[ProjectName.zip]
	MonoBleedingEdge
	[ProjectName]_Data
    UnityCrashHandler64.exe
    UnityPlayer.dll
    [ProjectName].exe
Unity Project Package Folder Structure

Next Steps

Now that your project is configured and packaged you’re ready to:

Further Reading

Why is the aspect ratio of my Unity stream incorrect?
If the aspect ratio of your Unity stream is not what you expect, there may be a reason for it, and a way to fix it!