Search Unity

Question Oculus Quest 2 + Mac OS + Unity, show preview mode

Discussion in 'VR' started by level8, Feb 22, 2021.

  1. level8

    level8

    Joined:
    Sep 4, 2020
    Posts:
    3
    Good morning,
    I'm new to the forum, so thanks to whoever will answer my question.
    I tried to make my preview mode in Unity work with my oculus Quest 2, but it seems it is rather difficult, although i tried to follow many guides/tutorial and searched through the forum.

    What i want to achieve:
    As a developer i would like (if possible) to have the preview mode of Unity working directly in the editor with Quest 2, this means that if i click the play button i would like that my app starts and i can use the Oculus Quest 2 Controller + Hands tracking to interact with my application (for example just keeping the Oculus on top of my head in order to be able to change the code and "refresh" the app, without the need of re-deploy to the device).

    What i was able to achieve:
    Oculus is recognized from my laptop, everything works as expected, and i can build and run my application inside the device with no issue. It is just the preview mode that does not work inside Unity.

    The question:
    Is one of you guys able to run the preview mode directly with the Oculus controller? If there is one person that was able to do it i 'd like to know if there are some specific steps to add to get it working. Also, if not, is there any work around?

    This will improve dramatically the dev experience that otherwise is rather slow and not comfortable.

    Just a note, i'm currently using the cable that was shipped with the Oculus to connect the device to my laptop and not the Oculus Link. Might this be the issue?

    Software:
    Mac OS Catalina
    Unity 2019.4.20
    Oculus Quest 2 with the latest update
    All the latest packages from XR + Android.

    Thanks a lot in advance!
     
    Gamingmindset likes this.
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I do Quest 2 development on my Mac, and no, I don't have any such preview mode. When I run within the editor I control my character using mouse/keyboard and/or a game controller (using code I wrote for that purpose).
     
  3. level8

    level8

    Joined:
    Sep 4, 2020
    Posts:
    3
    Thanks Joe, this makes sense. But let's say my application relies A LOT on the hands tracking, like for example capturing gestures, or actual distance among fingers or distance between fingers and other objects, how can you emulate this with custom code? I mean, in general this can be a good-ish approach, but i'd love to see my actual hands in the preview, at least this will speed up "A LOT" the dev process.

    For example the hands position (or hands figure recognition) would not be easy with custom code.

    In general my question comes cause i think is a pretty common use case that would help a lot.

    Anyway, do you know if this possible on Windows? Cause in this case i could potentially switch (with a lot of pain).

    As a side note, i was thinking on a different approach, that is 'casting' oculus, for example with the Developer hub. This will not clearly solve the build/deploy time, but at last i will be able to not constantly switch between device and monitor.
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I think it's possible on Windows, though I'm not certain.

    And yeah, it certainly could be better. I find the builds to the device are quick enough, and I can test enough things in the editor instead, that it's not a major problem for me. But I totally get where you're coming from.
     
  5. Stompy32

    Stompy32

    Joined:
    Nov 4, 2019
    Posts:
    1
    I was trying to do this too because I got tired of having to compile the whole program before I could test something.

    After looking around I found a solution but you won't like it. I used bootcamp and set up everything in windows. Works like a charm so far. (I'm about to switch my whole system to windows and just use that as my dev environment) :-/

    But it would be nice to get native support for this in unity for macOS. In 2021 a lot of macs have video cards that can handle this sort of thing and the software should reflect that.
     
  6. level8

    level8

    Joined:
    Sep 4, 2020
    Posts:
    3
    Thanks for the answers. In the end i found a decent compromise (maybe it is useful for you as well). I have 2 laptops (that's the bad part), in one i have the oculus developer hub, connected with WiFi, and on my mac (my main laptop) Oculus is connected with USB-C cable.

    I just CAST oculus from the developer hub (and also stream the logs) and i develop from my mac. No need to wear the device on anything.

    Hopefully in the future they will add the support for the preview, but till then this works quite decently.
     
    Gamingmindset likes this.
  7. jmhobrien

    jmhobrien

    Joined:
    Jul 9, 2013
    Posts:
    2
    Sorry to dig this one back up, but has anyone achieved the above setup? I've got build and run to install over airlink/wifi to Quest 2, but the quick play/preview button in Unity doesn't play nice...
     
    rahulchawla2801 likes this.
  8. Howey-Do-It

    Howey-Do-It

    Joined:
    Apr 19, 2013
    Posts:
    5
    My setup is a bit complex.

    Equipment:
    - M1 MacBook Air
    - Dell XPS 15
    - Oculus Quest 2

    Software:
    - Git or Unity Collaborate for project syncing
    - Virtual Desktop Streamer on XPS 15 for streaming to Oculus Quest 2
    - Modified Virtual Desktop for VR streaming on Oculus Quest 2

    Steps:
    1) Make changes on Mac
    2) Push changes on Mac
    3) Pull changes on Windows
    4) Press Play in Windows Unity Editor

    In addition, I use Parsec to control my Windows computer from my Mac.

    Complex, but effective. :)

    [EDIT: The only time this is a little weird is when Parsec and Virtual Desktop fight for mouse control. I have to point my controllers away from the virtual screen when trying to control the computer while running the project.]
     
    Last edited: Oct 1, 2021
  9. jalemanyf

    jalemanyf

    Joined:
    Jun 16, 2013
    Posts:
    25
    Do you find a better solution to do that? I't is a litle bit complex... thanks!
     
  10. dherault

    dherault

    Joined:
    Dec 19, 2019
    Posts:
    8
    Hi guys,

    I found a really good solution to this issue.
    I'm using Shadow, a Windows streaming platform that costs 30 euros per month. It's like a Windows virtual machine on your macOS computer, but it's streaming!

    Setup:
    - Shadow (https://shadow.tech --> coupon: DAVON3MY)
    - Use the alpha version of Shadow for macOS, then install the USB drivers in the Shadow menu before launching the stream.
    - Unity + Github desktop + Virtual Desktop Streamer on Shadow
    - Virtual Desktop Streamer on Oculus Quest 2 (costs some $ too)
    - I'm using this script to launch everything on Shadow (note the -cloudEnvironment arg) https://github.com/dherault/shadow-launch-unity (you should modify it to your needs, it can be added to the startup folder).
    - I used some software to swap the control and commands keys on Shadow so I can copy-paste like I'm on a mac.

    It works like a charm, when I press play it streams my Unity game right to my Oculus in 3D VR like expected.

    Best,
     
  11. MariusEthiel

    MariusEthiel

    Joined:
    Nov 13, 2021
    Posts:
    17
    So... If that's not possible in MAC, I guess
    But, is the preview mode working for you?. I mean, you can move around objects, "touching" objects (with a mouse and keyboard, but touching them)...
     
  12. vKrohn

    vKrohn

    Joined:
    Apr 12, 2020
    Posts:
    6
    Hi, I'm sitting on the same problem but two years later. Has anything changed in the meantime, is it possible to preview / play my app in Unity, but use the Oculus Quest 2 controller + headset motion to interact, when using a Mac?

    I can't find anything current and relevant for Mac on this topic online :/
     
    Gamingmindset likes this.
  13. Gamingmindset

    Gamingmindset

    Joined:
    Jul 20, 2023
    Posts:
    2
    Oh man! That’s really unfortunate that the experience is still challenging for Mac users. It's frustrating that the issue remains unresolved :/ I wish the awesome Unity team could take this matter into their improvement backlog.