- Home /
Question by
Thomvdm · Sep 13, 2017 at 12:25 PM ·
scripting probleminputaugmented-realityinteraction
HoloLens: detect Airtap regardless of Raycast hit
Hi,
I'm a bit stuck on the following, even though I'm sure it can't be too difficult. Currently I use the following code to detect an Airtap and do something:
public class Example: MonoBehaviour, IInputClickHandler {
public void OnInputClicked(InputClickedEventData eventData)
{
DoSomething();
}
}
However, this requires the script to be attached to a Gameobject, and requires for the Airtap to happen when the user is looking at said Gameobject.
This causes problems when for example wanting to open a menu that is not yet visible, or when placing/dragging an object that ignores raycasts.
How can I detect an Airtap, regardless of where the user is looking?
Thanks
Comment