Custom Input Device and MRTK 2.4 (GrabPointer doesn't work)
Describe the bug
After upgrading from MRTK 2.3 to MRTK 2.4, my custom input device is not fully working as expected. The SpherePointer(aka GrabPointer) is not working anymore. The Ray and Poke Pointers of my custom input device are working fine. I have also adopted the changes regarding SetupDefaultInteractions ...
To reproduce
Steps to reproduce the behavior:
- Create a new Unity Project
- Import MRTK 2.4
- Import my minimal reproduceable example package (see attachment)
- Open the BugScene and move the Custom Pointer inside the Box to "Grab"
The Custom Input Device is simulated with the Mouse (Left Click = Action Button; Right Click = Back Button) For moving it forward/backward, press "Z"/"H"
Expected behavior
When moving my Custom Pointer inside the GameObject (with BoundingBox and ObjectManipulator) and click with the left mouse to grab it, I should be able to grab, or interact with the Scale/Rotate Handles in NearInteraction.
Screenshots
The Object has a BoxCollider and works with the GrabPointer from the Articulated Hand.
My Setup
- Unity Version 2018.4.21f1 (but also with 2019.4.X)
- MRTK Version 2.4
Target platform
- HoloLens 2
Additional context
I am writing a custom controller plugin which should work with MRTK. With MRTK 2.3 it was all working fine. Now we wanted to support also MRTK 2.4, but are having problems with getting all pointers work as expected. The Controller gets its pose change like this:
CoreServices.InputSystem.RaisePoseInputChanged(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction, controllerPose);
And the Buttons Presses like this:
CoreServices.InputSystem?.RaiseOnInputDown(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction);
CoreServices.InputSystem?.RaiseOnInputUp(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction);
SpherePointer.cs
As you can see in the picture, the if statement was always false for me. I never assigned IsPositionAvailable to true.
Now inside my Controller I added such a line:
IsPositionAvailable = myControllerPosition != Vector3.zero;
That line fixed my problem.
@N0RAIR looks like this got fixed. Closing issue!