Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The Motive SDK supports WebGL builds in Unity. To use WebGL, use the WebGL Player prefab. WebGL Player uses standard mouse and keyboard input instead of XR controllers.

Local Development

Unity Editor

WebGL controls and input can be tested directly in the Unity editor. Use Unity testing to make sure authoring and configured components work as expected.

Local Web Server

Once you have verified that the app works in Unity, it can be exported to as a WebGL app. Unity offers both Build and Build and Run options. Build and Run starts a lightweight web service and opens the app in a web browser. This will likely result in errors trying to access the content due to security restrictions. This is our recommended approach to work around these issues. Note that these security issues will not appear when the app is deployed to Launch as describe below.

  1. Create a runweb.cmd command file and with the following line. Note that the Unity version should align with a version installed on your system.

    "C:\Program Files\Unity\Hub\Editor\2020.3.40f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\SimpleWebServer.exe" %1 8000
  2. Run the webserver and point it at the folder with the web build. This will start the server on port 8000 (or whatever port you assigned in the command above).

    > runweb.cmd Builds/WebBuild
  3. Now launch a browser with security features disabled. For example, the following command launches Chrome with CORS and other security disabled so that the calls to the service will work. By default, the browser will not make connections or send authentication cookies to an unknown URL. Note that the directory specified in “user-data-dir” must exist on your system or this call will fail.

    "C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=C:\chromeTemp
  4. You should be able to launch the web build in this browser by connecting to localhost:8000. Log into Storyflow in another tab in this browser to get the correct cookies on your system.

  • No labels