FirebaseWebGL
FirebaseWebGL copied to clipboard
unityinstance is not defined
I added unitypackage in the project and then call functions for auth and build WebGL, then I added my firebase config to the built index.html file and this.unityInstance = unityInstance line also, then I uploaded the build zip file on unity play. but now I am getting an error called: unityinstance is not defined. is there something I am missing or to add? Please help.
same here, encountering this issue.
@DNAniel213 @AyushShreshthi
Hello, You can fix that issue using this code:
onload = () => {
createUnityInstance(canvas, config, (progress) => {
}).then((unityInstance) => {
this.unityInstance = unityInstance;
}).catch((message) => {
alert(message);
});
};
Add that script to js file or in html code. It would be best to place the code under buildUrl. EXAMPLE:
I hope I helped ! :)
Thanks @Antonio-Gorisek