When GazePointerBehaviour set to AlwaysOn the GazeProvider.GazeTarget returns the object from hand
Describe the bug
When the GazePointer behaviour is changed through:
PointerUtils.SetGazePointerBehavior(PointerBehavior.AlwaysOn)
If hands are detected, the GazeProvider returns the object highlighted by the hands:
CoreServices.InputSystem.GazeProvider.GazeTarget
To reproduce
- Add an object to the scene
- Change the layer of the object to 31
- Create a script with the following code:
void Start() { PointerUtils.SetGazePointerBehavior(PointerBehavior.AlwaysOn); } void Update(): if (CoreServices.InputSystem.GazeProvider.GazeTarget?.layer == 31) { Debug.Log("Gaze!"); }
- Look at the object. The if statement is true, as it should.
- Change the camera direction so that the the gaze pointer is not on the object
- Enable the hands controller and point with the hand cursor to the same object
- The above if statement will be true, even if we are not gazing at it.
Expected behavior
Expecting to receive a null object from the GazeProvider when pointing the object with the hands controller, but instead receiving the object focused by the hands.
Your setup (please complete the following information)
-
Unity Version: 2019.4.9f1 and 17f1
-
MRTK Version: 2.2 and 2.4
-
Tested in the editor and the device (HL2)
Target platform (please complete the following information)
- HoloLens 2
Additional context
I'm not sure if this is the expected behaviour but it seems highly counter intuitive.
Since we need to have the gaze cursor always visible, this breaks all the object placements we use in our app. If you have any suggestions how to differentiate between the 2 inputs (gaze, hands) they are welcome.
Hey @Mitch753, are you able to reproduce this on MRTK 2.5?
@polar-kev Yes I tried in v2.53 and it's exactly the same behaviour. Setting PointerUtils.SetGazePointerBehavior(PointerBehavior.AlwaysOn) breaks the gaze pointer GazeProvider.GazeTarget
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.
From my read here, it looks like this should be fixed by #11148, as called out by @keith-phillips
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!