Search Unity

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

Question XR Simple Interactable - "On Activate" Usage

Discussion in 'AR/VR (XR) Discussion' started by ado20, Aug 30, 2020.

  1. ado20

    ado20

    Joined:
    Feb 27, 2015
    Posts:
    6
    Hi, I am working on VR Dashboard. I have a simple game object (should work as button) with "XR Simple Interactable" script attached on it. When I run this project I am able to trigger "On Hover Enter", "On Hover Exit" and even "On Select Enter", but for some reason I am not able to trigger "On Activate". Am I missing something ? What is the correct way to trigger this event ?
     

    Attached Files:

    VitasIII and Relec like this.
  2. eugenner

    eugenner

    Joined:
    Oct 28, 2020
    Posts:
    2
    I had accidentally pressed both a trigger and a grip buttons on my Oculus Quest 2 and as I see the event was fired. This works both with XR Device Simulator (should be pressed shift+G and mouse left button) and in the real device trigger + grip. Only I can't figured out how to connect that only with a trigger button...
    But with UI Button everything looks ok (works just with a trigger button).

    Aha, and from the docs: "Activation is an extra action, typically mapped to a button or trigger that affects the currently selected object." (https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@1.0/manual/index.html#setup)
     
    Last edited: Feb 10, 2021
    VitasIII, jayliu50 and kaasirc like this.
  3. Volorf

    Volorf

    Joined:
    May 9, 2017
    Posts:
    9
    as @eugenner said to fire the event you should select the interactable first, which should be done by holding the grip button. But you can make the selected state happen when you hover over the object in XR Ray Interactor settings. You need to tick the Hover to Select option to enable object selection when you hover it. In this case, the activated event will be fired when you hover over the interactable and press the trigger.

     
    Last edited: Jul 6, 2022
    VitasIII and Sigur_Studio like this.
  4. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    225
    There is also that new Allow Hovered Activate option above that was added in 2.0.0-pre.3 (2021-11-09) after the other couple posts that can allow you to activate something you are only hovering but not selecting.
     
    VitasIII and jayliu50 like this.