One of our partners is occasionally hitting a null reference exception within their application which breaks hand interaction input. We haven't had a chance to catch this issue in the debugger, but wanted to post it here in case anyone has seen this before.
The issue appears to be OnSourceDetected being fired on a null (destroyed?) PokePointer:
NullReferenceException: Object reference not set to an instance of an object.
at UnityEngine.Component.get_transform () [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.BaseControllerPointer.get_Position () [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.PokePointer.OnSourceDetected (Microsoft.MixedReality.Toolkit.Input.SourceStateEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem+<>c.<.cctor>b__191_0 (Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at System.EventHandler1[TEventArgs].Invoke (System.Object sender, TEventArgs e) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.BaseEventSystem.HandleEvent[T] (UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] eventHandler) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem.HandleEvent[T] (UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] eventHandler) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem.RaiseSourceDetected (Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource source, Microsoft.MixedReality.Toolkit.Input.IMixedRealityController controller) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.WindowsMixedReality.Input.WindowsMixedRealityDeviceManager.InteractionManager_InteractionSourceDetected (UnityEngine.XR.WSA.Input.InteractionSourceDetectedEventArgs args) [0x00000] in <00000000000000000000000000000000>:0
at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.XR.WSA.Input.InteractionManager.OnSourceEvent (UnityEngine.XR.WSA.Input.InteractionManager+EventType eventType, System.IntPtr statePtr, UnityEngine.XR.WSA.Input.InteractionSourcePressType pressType) [0x00000] in <00000000000000000000000000000000>:0
Steps to reproduce the behavior:
Unknown at this time. Perform poke and grab input on HoloLens 2, wait for input to stop working. Inspect the Unity player log.
Null reference does not occur.
Looking at the Unity log a bit more, the ProximityLight is warning that there are more than 2 proximity lights in the scene. Which hints that there are more than two PokePointers in the scene. Which could be a problem?
wondering if this might be related to this issue https://github.com/microsoft/MixedRealityToolkit-Unity/issues/6011
@davidkline-ms , @Cameron-Micka
I've just seen this same issue in MRTK 2.2.0 via NuGet
No solid repro, but once the system gets into this state I need to close/restart the application.
Max proximity light count (2) exceeded.
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogFormat(LogType, String, Object[])
UnityEngine.Debug:LogWarningFormat(String, Object[])
Microsoft.MixedReality.Toolkit.Utilities.ProximityLight:OnEnable()
UnityEngine.Object:Instantiate(Object, Transform, Boolean)
UnityEngine.Object:Instantiate(T, Transform, Boolean)
UnityEngine.Object:Instantiate(T, Transform)
Microsoft.MixedReality.Toolkit.Input.BaseControllerPointer:SetCursor(GameObject)
Microsoft.MixedReality.Toolkit.Input.BaseControllerPointer:OnEnable()
Microsoft.MixedReality.Toolkit.Input.PokePointer:OnEnable()
UnityEngine.Object:Internal_CloneSingle(Object)
UnityEngine.Object:Instantiate(T)
Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager:RequestPointers(SupportedControllerType, Handedness)
Microsoft.MixedReality.Toolkit.WindowsMixedReality.Input.WindowsMixedRealityDeviceManager:GetController(InteractionSource, Boolean)
Microsoft.MixedReality.Toolkit.WindowsMixedReality.Input.WindowsMixedRealityDeviceManager:InteractionManager_InteractionSourceDetected(InteractionSourceDetectedEventArgs)
System.Action`1:Invoke(T)
UnityEngine.XR.WSA.Input.InteractionManager:OnSourceEvent(EventType, IntPtr, InteractionSourcePressType)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
NullReferenceException: Object reference not set to an instance of an object.
at UnityEngine.Component.get_transform () [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.BaseControllerPointer.get_Position () [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.PokePointer.OnSourceDetected (Microsoft.MixedReality.Toolkit.Input.SourceStateEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem+<>c.<.cctor>b__196_0 (Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at System.EventHandler`1[TEventArgs].Invoke (System.Object sender, TEventArgs e) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.BaseEventSystem.HandleEvent[T] (UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] eventHandler) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem.DispatchEventToGlobalListeners[T] (Microsoft.MixedReality.Toolkit.Input.BaseInputEventData baseInputEventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] eventHandler) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem.HandleEvent[T] (UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] eventHandler) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem.RaiseSourceDetected (Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource source, Microsoft.MixedReality.Toolkit.Input.IMixedRealityController controller) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.MixedReality.Toolkit.WindowsMixedReality.Input.WindowsMixedRealityDeviceManager.InteractionManager_InteractionSourceDetected (UnityEngine.XR.WSA.Input.InteractionSourceDetectedEventArgs args) [0x00000] in <00000000000000000000000000000000>:0
at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.XR.WSA.Input.InteractionManager.OnSourceEvent (UnityEngine.XR.WSA.Input.InteractionManager+EventType eventType, System.IntPtr statePtr, UnityEngine.XR.WSA.Input.InteractionSourcePressType pressType) [0x00000] in <00000000000000000000000000000000>:0
(Filename: currently not available on il2cpp Line: -1)
Sounds like the same issue, thank you for the info @timGerken!
This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.
This issue has been closed by an automated process because it is stale. If this is still an issue please add a new comment with more recent details and repro steps.