Hello!
I have a project where I need to create a 2D scene minigame that switches to an AR scene minigame and finally to a 3D VR google cardboard minigame.
I can activate XR for the VR game succesfully with this method found in the documentation:
public IEnumerator StartXRCoroutine()
{
Debug.Log(“Initializing XR…”);
yield return XRGeneralSettings.Instance.Manager.InitializeLoader();
if (XRGeneralSettings.Instance.Manager.activeLoader == null)
{
Debug.LogError(“Initializing XR Failed. Check Editor or Player log for details.”);
}
else
{
Debug.Log(“Starting XR…”);
XRGeneralSettings.Instance.Manager.StartSubsystems();
}
}
But my problem is that this same method does not work for the AR scene.
This AR scene works perfectly if launched as the first scene and with “Initialize XR on Startup” ON.
But when switching from the 2D scene (and XR is not initialized) the method above, that works for initializing XR for the VR scene, does not work for this AR scene.
What am I missing here?
Thanks for any help!