title: Unity VR Controller UI Interaction
body: <p>I'm currently at the verge of a mental breakdown. I spent hours building my own laser pointer, making it shoot raycasts on everything and try to make it work with my UI. But it won't. At least not correctly. </p>
  
  <p>What works: Raycast and draw line.</p>
  
  <p>Where I struggle: Right now I have two options. 
  A) Standard UI button and cube without mesh renderer to it. This makes the button fade thru its animations according to its button script. BUT it won't resolve the On button click events! So I added an event trigger onto the button - which... will indeed trigger the "pointer enter" events! But not its "pointer click" events :(</p>
  
  <p>So what I thought: my click must be implemented wrong! To test this:
  B) Added an event trigger to the cube, that's the buttons collider. Set it to "pointer click". And tada! it works! BUUUUT this kills the animation of the button! Why?</p>
  
  <p>Thankful for any ideas! I'd also take new startpoints into consideration, if you have a good hint!</p>
  
  <p>Next issue are sliders. Any tipps on how to make them work?</p>
  
  <p>Thanks for any help!!</p>
  
  <p>Cheers
  Flo</p>
  
  <p>Edit: current code:</p>
  
  <pre><code>        {//Record this data and tell the object that we are pointing at them (OnPointerEnter)
          eventData.pointerEnter = rayHit.transform.gameObject;
          ExecuteEvents.ExecuteHierarchy(eventData.pointerEnter, eventData, ExecuteEvents.pointerEnterHandler);
  
  
          //If trigger becomes state down ...
          if (SteamVR_Actions._default.GrabPinch.GetStateDown(handType) &amp;&amp; eventData.pointerEnter != null)
          {
              //...tell the object that we have pressed it (OnPointerDown)
              eventData.pointerPressRaycast = eventData.pointerCurrentRaycast;
              eventData.pointerPress = ExecuteEvents.ExecuteHierarchy(eventData.pointerEnter, eventData, ExecuteEvents.pointerDownHandler);
          }
          //Otherwise, if we just released the primary input axis...
          else if (SteamVR_Actions._default.GrabPinch.GetStateUp(handType))
          {
              //...tell the object than we have stopped pressing it (OnPointerUp)
              if (eventData.pointerPress != null)
                  ExecuteEvents.ExecuteHierarchy(eventData.pointerPress, eventData, ExecuteEvents.pointerUpHandler);
  
              //...finally, if we pressed and released the same object, then we have clicked it (OnPointerClick)
              if (eventData.pointerPress == eventData.pointerEnter)
                  ExecuteEvents.ExecuteHierarchy(eventData.pointerEnter, eventData, ExecuteEvents.pointerClickHandler);
  
              eventData.pointerPress = null;
          }
      }
  </code></pre>