GitHunt
LA

larsbergstrom/unity-webvr-export

Unity assets for creating WebVR from Unity.

Unity WebVR Assets

WebVR assets for creating WebVR-enabled Unity3D projects.

Preview of Unity WebVR-exported project in the browser

Try it out!

Works with HTC VIVE and Oculus Rift using a WebVR-enabled browser.

Setup instructions

This flow has been tested with Unity versions 2017.2.0f3 and later.

To export an existing Unity project to WebVR:

  1. Download this ZIP file containing the contents of this repository. Or you can clone the Git repository locally to your machine:

    git clone https://github.com/caseyyee/unity-webvr-export.git && cd unity-webvr-export
  2. Launch Unity. (Download and install Unity, or upgrade to the latest version, if you have not already.)

  3. Open your existing Unity project: File > Open Project.

  4. Open File > Build Settings, and from the Platform list, select the WebGL platform.

  5. From Player Settings… (Edit > Project Settings > Player), select the WebGL settings tab (HTML5 icon), toggle to the Resolution and Presentation view, and select WebVR for the WebGL Template.

  6. Select File > Build & Run.

    Or select File > Build Settings …, and choose a location for your build.

  7. Once the build has completed, your web browser will automatically open the project. Make sure you are running the game in a WebVR-capable browser.

    Alternatively, if you ran Build, instead of Build & Run, you can run a local static-file web server and load the index.html document from your WebVR-capable browser.

Building the Unity Asset Package

If you are a maintainer of this project, you will want to update the Build/ directory (hosted online here) and the WebVR-Assets.unitypackage file.

  1. Launch Edit > Build Settings > Project Settings. From Player Settings… (Edit > Project Settings > Player), select the WebGL settings tab (HTML5 icon), toggle the Resolution and Presentation view, and select WebVR for the WebGL Template.

  2. Launch Edit > Build Settings > Project Settings. Then, press the Build and Run button, and Save to the directory named Build.

  3. Open Assets > Export Package…, and press the Export… button. Set WebVR-Assets as the filename of the destination Unity Asset Package, and press the Save button.

  4. A window titled Exporting package will appear. Click the Export… button to proceed.

License

All code and content within this source-code repository is, unless otherwise specified, licensed under the Creative Commons Zero v1.0 Universal license (CC0 1.0 Universal; Public Domain Dedication).

You can copy, modify, distribute and perform this work, even for commercial purposes, all without asking permission.

For more information, refer to these following links:

Languages

JavaScript48.8%C#22.1%HTML15.9%CSS13.2%

Contributors

Creative Commons Zero v1.0 Universal
Created January 13, 2018
Updated March 18, 2020
larsbergstrom/unity-webvr-export | GitHunt