How to use react-unity-webgl - 1 common examples

To help you get started, we’ve selected a few react-unity-webgl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeffreylanters / react-unity-webgl-test / src / App.js View on Github external
constructor(props) {
    this.speed = 30;
    this.state = { rotation: 0, unityShouldBeMounted: true };

    this.unityContent = new UnityContent(

    this.unityContent.on("Say", message => {
      console.log("Wow Unity said: " + message);

    this.unityContent.on("SendRotation", rotation => {
      this.setState({ rotation: Math.round(rotation) });

    this.unityContent.on("progress", progression => {
      console.log("Unity progress", progression);


React Unity WebGL provides a modern solution for embedding Unity WebGL builds in your React Application while providing advanced APIs for two way communication and interaction between Unity and React.

Latest version published 4 months ago

Package Health Score

76 / 100
Full package analysis

Popular react-unity-webgl functions