Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[WIP] HTC Vive Controller Events Using UnityEvents

Discussion in 'AR/VR (XR) Discussion' started by TrickyHandz, May 16, 2016.

  1. TrickyHandz

    TrickyHandz

    Joined:
    Jul 23, 2010
    Posts:
    196
    While I have been learning to use all the different inputs from the HTC Vive controllers, I put together a small component that uses UnityEvents to populate behaviors for button presses, releases, and touches. At the moment, I am primarily using this for my own prototyping, but I was wondering if anyone else would find this useful.

    The component will trigger events for the following at the moment:
    • Trigger Pressed
    • Trigger Released
    • Grip Button Pressed
    • Grip Button Released
    • Touch Pad Pressed
    • Touch Pad Released
    • Touch Pad Touch Started
    • Touch Pad Touched (i.e. touch pad is actively being touched)
    • Touch Pad Touch Ended
    • Application Button Pressed
    • Application Button Released
    Here is the inspector as it stands right now:
    ViveUnityEvents.png

    If you would find this useful please let me know what your expectations of such a system would be and if there is anything you think would be a nice addition to it. Thanks in advance to anyone that is willing to give me their thoughts on this.
     
    ViktorKom, getwilde and MS80 like this.
  2. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    72
    Yes, looks worthwhile if you're just starting developing for vive to determine how the different control calls happen and their sequence.
     
  3. getwilde

    getwilde

    Joined:
    May 4, 2016
    Posts:
    18
    This looks great! I just got something working last night, but it's not pretty. This would have been (and would still be) very handy.
     
    Last edited: May 17, 2016
    TrickyHandz likes this.
  4. TrickyHandz

    TrickyHandz

    Joined:
    Jul 23, 2010
    Posts:
    196
    @getwilde, Thanks for the quick comment on this. Right now everything I have is set up rather simply. I am considering creating a custom subclass of UnityEvent to tie it in better with the SteamVR toolset. As I work more on this I will post updates...probably some more to come later on this week.
     
  5. Pepe-Hoschi

    Pepe-Hoschi

    Joined:
    Feb 27, 2016
    Posts:
    8
    Looks really handy. Just what I need to trigger some UI stuff. I started yesterday to implement some UI code for the Vive controller. Your solution looks much better and far more advanced :D
     
    TrickyHandz likes this.
  6. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    77
    Heyyy! Very cool. Though I fear it may be short lived due to likely having native implementation in unity soon, it's still very handy to have right now for some folks. Never hurts having a choice of another road to go down. Thanks! :D