How to use Web Worker in the project

Hello, is there any ways that I can use Web Worker to the project? So far I have no luck implementing the web worker to my project. If it is possible, would there be any samples?

This project demonstrates two approaches to using web workers in an 8th Wall hosted experience: by uploading a worker script as an asset bundle or by creating an inline worker.

  1. Asset bundle: create the script in an external IDE, click + next to assets in the cloud editor > new asset bundle > other. Drag and drop your worker script into the asset bundle modal and ensure the main file is set to the worker script.
  2. Inline worker: create a blob with a stringified version of the worker script and an associated blob url.

You can then create the worker and communicate with it as demonstrated in app.js.

1 Like

Thank you for your help. I will try this approach.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.