NullReferenceException in UnityEngine.XR.VisionOS.InputDevices.VisionOSPlayModeInput.Awake

I am using Apple visionOS XR Plugin 2.0.4, PolySpatial 2.0.4, and Unity 6000.0.29f1. I tried to run the “Main” scene in Apple visionOS XR Plugin Sample, which uses Metal rendering. I also clicked “XR Simulation” in XR Plug-in Management. However, when I run this sample scene, there was an error log in the console “NullReferenceException: Object reference not set to an instance of an object
UnityEngine.XR.VisionOS.InputDevices.VisionOSPlayModeInput.Awake () (at ./Library/PackageCache/com.unity.xr.visionos/Runtime/Input/VisionOSPlayModeInput.cs:74)”.

Here are some screenshots:




The problem still exists in PolySpatial 2.1.2.

Hi @YUAN_YAO

I ran into this same issue - the workaround is to remove the component Vision OS Play Mode Input from the XR Origin object. This component requires PolySpatial to be running, however when running on the app mode Metal with Compositor Services PolySpatial is not initialized.

The scene will work in the hybrid app mode or when built to the device (with the error) but it is a bummer that the metal example scene won’t run in the editor when set to metal.

Would anyone @unity be able to respond to this issue?