Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
GamerReality's avatar
GamerReality
Start Partner
2 years ago
Solved

How to handle being a truly OpenXR game with some Oculus OpenXR features?

Hello, I'm building a game for every platform, Steam and Meta, and it works that way so far. I've read Meta documentation, and it seems like I'm supposed to use Meta's "OpenXR" rig for some features...
  • baroquedub's avatar
    2 years ago

    Hi GamerReality When you say you want to develop for every platform "Steam and Meta", I'm assuming that you're targeting PCVR, rather than standalone? I also use HurricaneVR and my current strategy is to just use their TechDemoXRRigOpenXR as a starting point, and the Unity OpenXR Plug-in, rather than the Unity OpenXR: Meta or the legacy Oculus XR Plugin
    For info there's an interesting conversation about the the differences between the three on the Unity forums)

    My thinking is that since Meta are obviously more focused on their standalone platform, there's little point directly targeting Meta headsets for PCVR. That store is dead (the focus is on the Horizon Store for standalone apps) and most people will be going through Steam. That doesn't mean you can't leverage some of the Meta SDKs. For example, I always import the Meta Audio SDK to make use of its excellent spatializer plug-in.

    If you're building for both PCVR and standalone then things get more complicated. I'd suggest researching into solutions for building to multiple platforms. One option is to load in multiple XR Management package profiles (e.g., OpenXR for PC, Meta XR for Quest), configure each profile for each platform and then automate your build pipeline (there's a Unity API) switching between platform-specific configurations (including XR Management profiles) before each build. You'll need to use conditional compilation (e.g #if UNITY_XR_OPENXR or #if UNITY_XR_META) for platform-specific code. It's messy and can get complicated!

    Another strategy that I've used in the past (back in the day of trying to build the same project to both GearVR and Google Cardboard) is to mirror your project folder (essentially just the 'Assets') but exclude files and folders across each one, depending on what's needed for each platform. It's cleaner but has its own limitations. There's an asset that can help the synchronisation process between the 'cloned' projects. https://assetstore.unity.com/packages/tools/utilities/ng-sync-folders-free-101015

    Hope that helps!