Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Air Tap event not triggered.. help?

GkoowGkoow
edited March 2017 in Questions And Answers

Hi All,

I recently have started to work with the Hololens and im currently facing an issue.

I am trying to see if i can get an AirTap event triggered. Well there is alot of documentation currently but dont know which one is correct and up to date. So thats why I am asking you guys. I am using the latest holokit and Unity 5.5.1f1 (64-bit).

-
I have added a script to a gameObject which is a child of the hololens.
This is my cursor so i know on what i can point it on.
Via the Gazemanager i am able to transform a hologram ( sphere) which i have added to the scene.

What i want to achieve now is that whenever i "airtap" i want the event to be triggered so that i can do an action on it. ( add a resource or destroy the object which has been identified through the raycast)

I have an object called GazeCursor which I have added a script towards it. (Gazecursor.cs)

i have extended it with an inputClickhandler interface.
public class GazeCursor : MonoBehaviour, IInputClickHandler.

created a method :

public void OnInputClicked(InputClickedEventData eventData)
{
    Debug.Log("AIRTAP REACHED");

when i am running the emulator i can press with the spacebar to simulate an airtap. But somehow it doesnt get triggered at all.

I am missing something here but i cant seem to figure it out.
Any help is very much appreciated.

Best Answer

  • Options
    GkoowGkoow
    Answer ✓

    I have managed to solve this one:).

    The thing is,i used a raycast on a cursor(a mesh of a cube) so the box Collision is disabled ( else the box would come towards you as the position keeps changing.)
    Instead i added a new script on the object that needs to have a event on a trigger.

    This object ( a sphere) i enabled box collision and checked the "is Trigger". This way it receives all the events that are on this object.

    So now i can click on the object with my (selfmade cube) cursor on the object to have the trigger event triggered.

Answers

  • Options
    GkoowGkoow
    Answer ✓

    I have managed to solve this one:).

    The thing is,i used a raycast on a cursor(a mesh of a cube) so the box Collision is disabled ( else the box would come towards you as the position keeps changing.)
    Instead i added a new script on the object that needs to have a event on a trigger.

    This object ( a sphere) i enabled box collision and checked the "is Trigger". This way it receives all the events that are on this object.

    So now i can click on the object with my (selfmade cube) cursor on the object to have the trigger event triggered.

Sign In or Register to comment.