Hi there, I’m currently building a cross platform app for Quest 3 and the AVP. It’s a pretty simple app with just hand tracking and some plane classification from the AR Foundation. I’m pretty much at the final stage where I’ve tested the app on both platforms and it works as expected.
However, I’m trying to streamline development for the future through the use of Preprocessor Directives to automatically enable the correct XR rig for either AVP or Quest. I have a script that essentially just does the following. I’ve set it to run on Awake and the script execution order to be the very first. It works for Android, but not visionOS oddly enough. Any thoughts why this might be? Thanks.
public void Awake()
{
#if UNITY_VISIONOS
VisionRig.SetActive(true);
QuestRig.SetActive(false);
VisionOSVolumeCam.SetActive(true);
environmentManager.SetCamTrans(VisionCamTrans);
# elif UNITY_ANDROID
VisionRig.SetActive(false);
QuestRig.SetActive(true);
VisionOSVolumeCam.SetActive(false);
environmentManager.SetCamTrans(QuestCamTrans);
#endif
}
Unity Version 2022.3.27f1
Polyspatial Version 1.2.3