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!