Search Unity

  1. Unity wants to learn about your experiences working on a Unity project today. We'd like to hear from you via this survey.
    Dismiss Notice
  2. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice
  3. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Issue with WebGL builds within VR/Oculus project

Discussion in 'AR/VR (XR) Discussion' started by Kamalen, Jan 19, 2020.

  1. Kamalen

    Kamalen

    Joined:
    Dec 27, 2012
    Posts:
    29
    Hi,

    I have a project I intend to have two clients ; a VR client and a WebGL client. I am using the Oculus Integration package as well to build to Oculus Quest.

    While everything runs correctly in Android, when I try to build the project in WebGL, I have an error concerning the Microphone class.

    When stubbing it, build work but the WebGL player cause the following error :
    "To use dlopen, you need to use Emscripten's linking support"

    This error looks to be caused by Oculus Integration, because when removed, the player works successfuly.

    Is there a way to make WebGL and Oculus Integration work in the same project ? There is very few things different between clients, so I'd rather not having separate projects, because sharing code is such a chore in Unity.

    Thanks !
     
  2. Thronost

    Thronost

    Joined:
    Nov 25, 2016
    Posts:
    2
    Hi, I'm having the same problem.
    Did you ever found a solution?
     
  3. Kamalen

    Kamalen

    Joined:
    Dec 27, 2012
    Posts:
    29
    I eventually worked around by making actually two separated projects ; a WebGL and a Oculus. My assets got on both projects using a folder with logical links, and only the Oculus project had the Oculus integration & Unity XR packages.

    For the few of my scripts depending on XR, I used #if UNITY_WEBGL to comment them out.

    If you want more details, feel free to ask. :)
     
  4. mafima

    mafima

    Joined:
    Jun 17, 2016
    Posts:
    6
    You can also create an Assembly definition to skip the Oculus scripts for the WEBGL build to fix the error.

    upload_2020-11-30_10-12-50.png
     
    CrispyCritter likes this.
  5. CrispyCritter

    CrispyCritter

    Joined:
    May 11, 2018
    Posts:
    17
    have you tried this? i have had no luck :(
     
unityunity