Hand ray disappears when hand gets near SR
Hand rays should only disappear when hands are near grababble or touchable things, not when the hand is near a non-interactive element like SR (the surface mesh).
Additional Context
This is happening because SpherePointer.IsNearGrabbable will return true if it is near ANY collidable, but it should only return true if it is near something that is grabbable (has NearInteractionGrabbable component on it).
And instead of doing an extra sphere cast we should just take advantage of focus system and just check if the sphere pointer is focusing anything.
Workaround
Here's how you can work around this issue, for the SR mesh:
LayerMask toIgnore = LayerMask.GetMask("Spatial Awareness") | UnityEngine.Physics.IgnoreRaycastLayer;return UnityEngine.Physics.CheckSphere(position, NearObjectRadius, ~toIgnore);
Add that in SpherePointer.cs wherever Physics.CheckSphere runs.
This bug was filed a while back I think in response to some code review. At the time this was brought up, but the author actually fixed it in the same review and so this bug immediately went stale.
https://github.com/microsoft/MixedRealityToolkit-Unity/blob/mrtk_development/Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Cursors/FingerCursor.cs#L199
The original bug references this section, which used to do a sphere raycast (instead of just an interactiongrabbable search)
tl;dr this was fixed in the same PR that this issue was filed against so it's not relevant anymore
suggestion for fix: create a 'grabbable layer mask' similar to what the poke pointer does with poke layer masks, and in SpherePointer.IsNearObject, query using the grab layer mask filter.
Addison had previously created this solution, but then I reverted it to reduce risk from his change, because the layer mask was unrelated to his PR. We should bring that change back in.
Marking urgency soon since it blocked several people who were using sr meshes in MRTK.
fixed.