Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL build issue #1

Open
Kavindu92 opened this issue May 31, 2022 · 3 comments
Open

WebGL build issue #1

Kavindu92 opened this issue May 31, 2022 · 3 comments

Comments

@Kavindu92
Copy link

After build and run to WebGL format, when pressed "Recode button" the borswer show an error alert. It says - "An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: ReferenceError: StartMic is not defined"

function unityFramework(Module) {
var Module=typeof Module!=="undefined"?Module:{};

Screenshot 2022-05-31 at 10 36 15

@Reavenk
Copy link
Owner

Reavenk commented Jun 2, 2022

See MicRoutines.js in the Deployment folder.
There's a sample including the js file in the test.html sample.

@hrabkin
Copy link

hrabkin commented Jul 18, 2022

The demo worked for me with some changes specifically in WebGL template. There were changes in Unity 2020.1 to the webgl loader

I followed this guideline in section Add WebGL template

You now can create your custom WebGL template and set it in PlayerSettings, unity instance config is loaded internally now, you can initialize and store unity instance using onSuccess callback of the promise
var unityInstance; .... createUnityInstance(canvas, config, onProgress)..then((unity) => { unityInstance = unity; }).catch(onError)

@Reavenk great idea with the fcmpointer, thanks for the research

@chopin1998
Copy link

do you have a new reference demo ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants