we are facing an issue with some XR Subsystems after reloading our scene.
Everything is working fine after the startup, but after reloading the scene (after dying in the game) the input stops working with an error message:
ar_hand_tracking_provider_get_latest_anchors <0x281e0ed10>: Cannot get latest hand anchors, the provider is not running.
We are getting more messages before this:
No active UnityEngine.XR.ARSubsystems.XRCameraSubsystem is available. This feature is either not supported on the current platform, or you may need to enable a provider in <b>Project Settings</b> > <b>XR Plug-in Management</b>.
UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3:GetActiveSubsystemInstance()
UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3:OnEnable()
No active UnityEngine.XR.ARSubsystems.XRRaycastSubsystem is available. This feature is either not supported on the current platform, or you may need to enable a provider in <b>Project Settings</b> > <b>XR Plug-in Management</b>.
UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3:GetActiveSubsystemInstance()
UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3:OnEnable()
UnityEngine.XR.ARFoundation.ARTrackableManager`5:OnEnable()
UnityEngine.GameObject:AddComponent()
UnityEngine.XR.Interaction.Toolkit.XRRayInteractor:FindCreateARRaycastManager()
Any help is highly appreciated since we’re a launch title and we need to get this ready soon! Thanks!
I figured out that this is also the case for the Unity Sample scene “Mixed Reality”.
Even if I restart the HandsProvider manually, the provider will log the message “Cannot get latest hand anchors” and delivers the last known position data from the previous loaded scene.
I filed a bug with ID IN-66060. This is a real BLOCKER and is delaying our release!
Just checking - in order for things to work thru a scene load, you need your ARSession script on a game object set to DontDestroyOnLoad. That might not be the issue you are seeing, but thought I’d point it out in case it helps. For us, we only persist the ARSession, and do everything else fresh on scene load…
We managed to fix this with the help of your advice @puddle_mike!
Just making the ARSession object persistent didn’t work for us. What we do now is starting a scene with just a ARSession and a volume Camera. The session is made persistent in Awake and loads the actual scene in Start.
Thanks for helping out!
EDIT: The volume camera seems to be optional, depending on your setup or specific use case.
Awesome, good to hear! We also use a starter scene, but ours just has the ARSession. Maybe because our app is fully immersive and doesn’t use VolumeCamera, it works a little different…
We’re going with a Progressive app, handled via swift. I think we need the volume camera because we’re doing some scaling and converting from volume to window in swift and without the camera scaling and positioning get messed up. So I guess it’s optional to have the cam, I’ll add this to the solution