Search Unity

Question Unity + Quest 2 Editor Realtime VR Preview *on Mac*

Discussion in 'VR' started by Xander-Davis, Apr 2, 2021.

  1. Xander-Davis

    Xander-Davis

    Joined:
    Apr 23, 2011
    Posts:
    441
    I just got the Quest 2 and am establishing how to work with it with Unity. I've been able to get XR Management and Oculus Integration into the project, turned on Oculus for Plug-in Providers under XR Management for both PC (Mac/Win/Linux) and Android, Initialize XR on Startup is on for both PC and Android under XR Management, used an example scene from Oculus, converted to Android, connected the Quest 2 with the official Quest Link cable, set the Run Device dropdown to the Quest 2 under Build Settings (confirming it is detecting the device), and got it to build and deploy successfully to my Quest 2 from Unity. It all works correctly on running a deployed build on device, Quest 2 HMD and Controllers.

    However, I'm wanting to primarily (even solely) develop on Mac. My 2018 maxed out MacBook Pro should be more than powerful enough to handle Unity development for the Quest 2. I have the Oculus Developer Hub for Mac installed (which also shows the Quest 2 successfully connected).

    And yet, neither the HMD nor the Controllers respond at all in Editor on Play. It's just a locked camera and no response from pressing anything on controllers (unlike in the deployed build on device). When putting the Quest 2 on in Editor while Playing, nothing happens (I just see the Home VR environment and the Universal menu as usual).

    I found these links/guides:
    https://www.reddit.com/r/OculusQues...lus_link_users_optout_of_the_oculus_home_ptc/
    https://gamedevbill.com/how-to-use-quest-link-in-unity/

    But it says you need to have the Oculus desktop app (not to be confused with the Developer Hub) open while in Unity for this to work. Oculus desktop app is meant for the Rift. And since that's Windows only, that's a problem for Mac users. When I have the Developer Hub open with Unity, no help— in fact it generally anti-helps as it removes the Quest 2 from the Run Device dropdown in Build Settings. Tried with both Unity 2021.1.0f1 and 2020.3.2f1 (LTS) under 3D or URP.

    Anyone know how to get realtime VR preview working in editor on Mac? It is kind of insane that this doesn't just work out of the box by now. It's literally almost been a full decade since the Oculus Kickstarter (and DK1 fully worked on Mac and in the Unity editor!)

    Thanks for your help!
     
    Last edited: Apr 2, 2021
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    As far as I know, what you want isn't possible. I do all my Quest development on a Mac, and I've just learned to live with it.
     
    egekaya1895 likes this.
  3. amaestas

    amaestas

    Unity Technologies

    Joined:
    Feb 5, 2020
    Posts:
    18
    Oculus does not support running on mac.

    You can build and deploy to quest but running in the editor (in vr with tracking and the like) is not supported as there is no oculus runtime for mac.

    The closest you could come is to utilize MockHMD. This will at least allow you to test shaders and other effects which may have issue when rendered in stereo.
     
  4. amaestas

    amaestas

    Unity Technologies

    Joined:
    Feb 5, 2020
    Posts:
    18
    Oculus dropped mac runtime support years ago (2015 I believe). They did support it for a while but have not since.
     
  5. amaestas

    amaestas

    Unity Technologies

    Joined:
    Feb 5, 2020
    Posts:
    18
    Also having Oculus Dev Hub open shouldn't remove the Quest from the build output dropdown unless its killing the adb instance unity is using.

    We can look into this cause that seems to be a bug.
     
    Xander-Davis likes this.
  6. Xander-Davis

    Xander-Davis

    Joined:
    Apr 23, 2011
    Posts:
    441
    Thanks for the replies all. I've been living without this so far and it generally hasn't been a huge issue. It would be easier if it could work in editor, but builds are completing and deploying to device fairly quickly, especially by selecting only the current scene I'm working on to test.

    However, I would strongly urge both Unity and Oculus work together to enable realtime VR preview in editor on playback on Mac. It's more critical to have this for VR than, say, developing for smartphone devices, since the experience of looking at a smartphone screen or the screen in the editor is generally the same but experiencing a Unity scene in VR is immensely different than on flatscreen in editor currently. Being able to rapidly test what that's like while building scenes would help considerably.

    Thanks!
     
  7. mentalgear

    mentalgear

    Joined:
    Jul 19, 2019
    Posts:
    23
    Hi Xander, did your approach evolve on this issue, or do you still need to build and deploy to test ?
     
  8. jmhobrien

    jmhobrien

    Joined:
    Jul 9, 2013
    Posts:
    2
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's really an Apple problem because your one shot at his was with OpenXR and Apple does not support it.
     
    Halfspacer likes this.