Custom WebGL Template not working?

I am trying to integrate this custom WebGL template into my game but I keep on having issues.

<!DOCTYPE html>
<html lang="en-us">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes">
    <title>Student Driver</title>
    <style>
      canvas {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
      }
    </style>
  </head>
  <body style="text-align: center">
    <canvas id="unity-canvas"></canvas>
    <script src="Build/UnityLoader.js"></script>
    <script>
      createUnityInstance(document.querySelector("#unity-canvas"), {
        dataUrl: "Build/Student Driver.data.unityweb",
        frameworkUrl: "Build/Student Driver.wasm.framework.unityweb",
        codeUrl: "Build/Student Driver.wasm.code.unityweb",
        streamingAssetsUrl: "StreamingAssets",
        companyName: JSON.stringify(RGames),
        productName: JSON.stringify(StudentDriver),
        productVersion: JSON.stringify(1.0),
        matchWebGLToCanvasSize: true,
        devicePixelRatio: 1,
      })
    </script>
  </body>
</html>

The error I keep on getting now is createUnityInstance not found. I have never done this before and I would appreciate some input on what I am doing wrong. I followed this to attempt to get it to work:

Thanks!

Try using an existing template, copy and modify it to your needs.
The documentation mentions where the templates are located:
<Unity Installation>/PlaybackEngines/WebGLSupport/BuildTools/WebGLTemplates/

1 Like

Well, have you actually checked the console for other errors before the one you mentioned? Have you checked the network tab if some file couldn’t be loaded? The error suggests that the loader script could not be loaded.

Don’t focus too much on what a tutorial tells you. See where your files are actually located on your server, test if you can load them / reach them manually. The browsers development tools are your best friend here.