microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

MRTK still activates when MixedRealityToolkit is disabled in scene #10298

Closed qian256 closed 9 months ago

qian256 commented 2 years ago

Describe the bug

When MixedRealityToolkit.cs is disabled in scene, MRTK still loads up when playmode starts / app starts. e.g. default gaze cursor is created.

Expected behavior

MRTK should not run.

Your setup (please complete the following information)

Target platform (please complete the following information)

polar-kev commented 2 years ago

Hey @qian256, what is the context in which you're disabling MixedRealityToolkit.cs and are there other error messages logged?

MiPa12 commented 2 years ago

Hi, I have the same issue. I need to disable MixedRealityToolkit, because I need to switch between different cameras/devices. More details to my problem are described in issue #10321 and #10278. So I tried to rename my other camera tags and keep the MainCamera tag only for the VR camera. When I start playmode with a different camera I need to disable the MixedRealitytoolkit otherwise it is searching for the MainCamera tag which is not available since the VR camera is disabled at the beginning...so this would lead to an error, but when I disable the MixedRealiyToolkit and start playmode I got the follwing error:

NullReferenceException: Object reference not set to an instance of an object Microsoft.MixedReality.Toolkit.Input.GazeProvider.InitializeGazePointer () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation@3a8abd5a981a-1635240051613/Services/InputSystem/GazeProvider.cs:508) Microsoft.MixedReality.Toolkit.Input.GazeProvider.get_GazePointer () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation@3a8abd5a981a-1635240051613/Services/InputSystem/GazeProvider.cs:112) Microsoft.MixedReality.Toolkit.Input.GazeProvider.get_GazeOrigin () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation@3a8abd5a981a-1635240051613/Services/InputSystem/GazeProvider.cs:134) Microsoft.MixedReality.Toolkit.Input.GazeProvider.LateUpdate () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation@3a8abd5a981a-1635240051613/Services/InputSystem/GazeProvider.cs:393)

My setup: Unity Version [e.g. 2020.3.17f1] MRTK Version [e.g. v2.7.0 and v2.7.2] - I tried both

qian256 commented 2 years ago

@polar-kev my usecase is a remote app. So when app starts while remoting is not started, i want my app to be a normal 2D app, without gaze cursors and etc. Also at this time, there is no XR input, so gaze is really not useful. I would disable MRTK script, and expect MRTK to not run at this time. When remoting starts, I want to enable MRTK to load up all MRTK features.

stale[bot] commented 2 years ago

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.

IssueSyncBot commented 9 months ago

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visithttps://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!