MixedRealityToolkit-Unity
MixedRealityToolkit-Unity copied to clipboard
Activating / deactivating core services causes errors
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
Add MRTK to a scene. Hit Play. Start activating and deactivating services.
@Railboy, are you activating / deactivating from the profile?
Yes, with the editor toggles.
Thanks! We will investigate.
is this fixed with the referenced PRs?