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
6.01k stars 2.12k forks source link

Toggle switch to stop gaze input from deactivating #10103

Closed boersig closed 3 years ago

boersig commented 3 years ago

Describe the problem

I need the gaze input (without eye tracking) to be active at all times. At the moment it deactivates when my hands enter the Hololenses FOV.

Describe the solution you'd like

A simple toggle switch in the inspector saying something like "keep gaze input active at all times"

Describe alternatives you've considered

Thank you very much advance!

boersig commented 3 years ago

Hello,

Could you tell me if you plan on implementing something like this in the near future, so that I know wether I should wait for it or build my own ad-hoc solution?

Thank you in advance!

keveleigh commented 3 years ago

You're likely going to want to look into the PointerBehavior concept in MRTK. We have some helpers at https://github.com/microsoft/MixedRealityToolkit-Unity/blob/265a0ea3621c84b88e4b02e7fcd1b5682afef56a/Assets/MRTK/SDK/Features/UX/Scripts/Utilities/PointerBehaviorControls.cs that might be usable in this case (things like SetHoloLens1() turn off hand rays but keep the gaze pointer on). You can also just explicitly set the gaze pointer to be AlwaysOn using the same patterns, if you aren't looking to change other pointers at the same time:

PointerUtils.SetGazePointerBehavior(PointerBehavior.AlwaysOn);
boersig commented 3 years ago

Perfect, this was exactly what I needed!

Thank you very much✌