I need to get the coordinates of the collision between the gaze pointer and an objects in Hololens, when the object is "clicked".
All the examples use MRTK1, how do you do this in MRTK2? I know you need to use the cursor, but how do you get it= It only appears when I actually run the code.
This is what I have so far:
using Microsoft.MixedReality.Toolkit.Input;
public class MoveTo : BaseInputHandler, IMixedRealityInputHandler
{
public GameObject Sphere;
public GameObject Cursor;
public void OnInputUp(InputEventData eventData)
{
GetComponent<MeshRenderer>().material.color = Color.red;
}
public void OnInputDown(InputEventData eventData)
{
Vector3 gazePos = Cursor.transform.position;
Sphere.transform.position = gazePos;
GetComponent<MeshRenderer>().material.color = Color.green;
}
}