Search Unity

Question XR Simple Interaction Activate

Discussion in 'XR Interaction Toolkit and Input' started by xbertou, Aug 10, 2021.

  1. xbertou

    xbertou

    Joined:
    May 3, 2021
    Posts:
    8
    Hi,
    this must be really dumb, but I've been looking at it in all possible directions and can't see what I am doing wrong...
    I am using the XR Interaction kit with the default XRI actions loaded (Quest 2). I have a button in a Canvas (with a Tracked Device Graphic Raycaster) and when I point to it with my raycaster it highlights. I click on my trigger and it calls the Onclick function I defined... All good.
    Then I have a GameObject with a mesh collider, and an XR Simple Interactable. If I fill the Select (Select Entered for example), when I click the Grab button on my controller I call the entered function, again all good.
    However, if I put something in the Activate (Activated), nothing happens when I press the trigger button... The function is not called...
    I am really puzzled as clearly the Activate is properly configured as it works with the button... Am I missing something basic (I am really new at Unity).
    Thanks for any indication on what I could test...
     
  2. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    232
    The UI Press action is used for doing clicks in UI. The Select action is for selecting interactable objects. The Activate action is not related to the UI Press action other than both input actions use the same triggerPressed binding path in the XRI Default Input Actions asset.

    For the Activate events on the Interactable (Activated/Deactivated), the object must be selected first. So if you pick up an object by selecting it with the grip, and then pull the trigger to activate, it will fire the Activated event. This is for something like a flashlight that you can pick up and then use the trigger to toggle the light.