MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Activating / deactivating core services causes errors

Open Railboy opened this issue 7 years ago • 4 comments

Overview

Activating and deactivating core MRTK services causes errors.

Expected Behavior

Services should be able to handle when they or other services are activated / deactivated.

Actual Behavior

  • Starting with all services activated and deactivating any service causes the following errors:
There's already a UIRaycastCamera in the scene. It will be ignored, so please delete it to avoid confusion.
UnityEngine.Debug:LogError(Object, Object)
Microsoft.MixedReality.Toolkit.Input.FocusProvider:Initialize() (at Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:427)
ArgumentNullException: Value cannot be null.
Parameter name: _unity_self
Microsoft.MixedReality.Toolkit.Windows.Input.GestureRecognizerExtensions.UpdateAndResetGestures (UnityEngine.XR.WSA.Input.GestureRecognizer recognizer, UnityEngine.XR.WSA.Input.GestureSettings gestureSettings) (at Assets/MixedRealityToolkit/Extensions/GestureRecognizerExtensions.cs:11)
MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule.GetMousePointerEventDataForMrtkPointer (Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule+PointerData pointerData) (at Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputModule.cs:176)
  • Starting with all services activated and deactivating InputSystem in particular causes the following errors:
Unable to find IMixedRealityInputSystem service.
UnityEngine.Debug:LogError(Object)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:GetService(String, Boolean) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:258)
NullReferenceException: Object reference not set to an instance of an object
Microsoft.MixedReality.Toolkit.Input.BaseCursor.UpdateCursorTransform () (at Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Cursors/BaseCursor.cs:360)
Microsoft.MixedReality.Toolkit.Input.BaseCursor.Update () (at Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Cursors/BaseCursor.cs:288)
  • Starting with all core services deactivated causes the following errors:
Unable to find IMixedRealityInputSystem service.
UnityEngine.Debug:LogError(Object)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:GetService(String, Boolean) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:258)
NullReferenceException: Object reference not set to an instance of an object
Microsoft.MixedReality.Toolkit.Input.GenericPointer..ctor (System.String pointerName, Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource inputSourceParent) (at Assets/MixedRealityToolkit/Providers/GenericPointer.cs:23)
  • Starting with all services deactivated and then re-activating the InputSystem causes the following error:
NullReferenceException: Object reference not set to an instance of an object
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule.GetMousePointerEventDataForMrtkPointer (Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule+PointerData pointerData) (at Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputModule.cs:176)

There may be other combinations which cause additional errors.

Steps to reproduce

Add MRTK to a scene. Hit Play. Start activating and deactivating services.

Unity Editor Version

2018.3.3f1

Mixed Reality Toolkit Release Version

Development branch

Railboy avatar Apr 11 '19 19:04 Railboy

Add MRTK to a scene. Hit Play. Start activating and deactivating services.

@Railboy, are you activating / deactivating from the profile?

david-c-kline avatar Apr 11 '19 20:04 david-c-kline

Yes, with the editor toggles.

Railboy avatar Apr 11 '19 21:04 Railboy

Thanks! We will investigate.

david-c-kline avatar Apr 11 '19 23:04 david-c-kline

is this fixed with the referenced PRs?

Yoyozilla avatar Jul 24 '19 05:07 Yoyozilla