A lightweight Unity library that exposes the WebXR JavaScript API in C# for building AR/VR experiences in the browser.
SimpleWebXR is a Unity library that exposes the WebXR JavaScript API to C#, allowing developers to build augmented reality and virtual reality applications that run in web browsers. It enables Unity projects compiled to WebGL to access immersive XR sessions, input controllers, hand tracking, and other WebXR features directly from C# code. The library solves the problem of bringing native-like XR experiences to the web without requiring platform-specific builds.
Unity developers who want to create AR/VR experiences that run in browsers across multiple devices, including smartphones, headsets like Oculus Quest and HoloLens, and desktop emulators. It is particularly useful for those leveraging WebGL builds and seeking a lightweight integration with WebXR.
Developers choose SimpleWebXR for its simplicity and minimal setup—it requires only a few files and a MonoBehavior to start. Unlike more complex alternatives, it provides a direct mapping of WebXR APIs to C# with support for popular frameworks like MRTK, making cross-platform XR development faster and more accessible.
⭐ Bringing WebXR to Unity 3D ! B-)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Only three core files and a MonoBehavior component are required to start, with no complex WebGL templates needed, making integration straightforward as highlighted in the README.
Supports Chrome on Android, Edge on HoloLens, Oculus Browser, iOS via WebXR Viewer, and emulators, ensuring cross-platform compatibility for diverse XR hardware.
Provides hand tracking, controller buttons, axes, and haptic feedback through the WebXR API, enabling rich interaction models directly in C# code.
Includes scripts for MRTK integration, allowing developers to leverage Mixed Reality Toolkit components for hand interaction, spatial pointers, and teleportation.
Running builds locally requires installing WebXR emulators, setting up HTTP servers with SSL certificates for secure contexts, which adds significant setup overhead.
The browser-based spectator view operates at only 10 FPS, much lower than native solutions like Microsoft's 60 FPS spectator view, as admitted in the README comparison.
Features like hand tracking require end-users to manually enable browser flags (e.g., dom.webxr.hands.enabled), creating friction and potential support issues.