Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to interact with UI buttons using the SteamVR Laser Pointer component.

Discussion in 'VR' started by unity_g6gzH7F3PjzA7Q, May 6, 2021.

  1. unity_g6gzH7F3PjzA7Q

    unity_g6gzH7F3PjzA7Q

    Joined:
    Jan 19, 2021
    Posts:
    2
    I'm quite new to Unity and to VR development, so I'm having trouble getting the SteamVR Laser Pointer to work with UI. I'm using the player prefab for the rig and have attatched the component to each hand. Then, I have a script (taken from here) with which I can see when the raycast is clicking, hovering over or exited a given collider. The button I'm trying to interact with has a collider, and I've managed to interact with it using the Interactable and UIElement when touching it.

    Now I just can't figure out how to do the same but with the laser pointer. What am I missing to get this interaction?

    Thanks in advance!
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,896
  3. unity_g6gzH7F3PjzA7Q

    unity_g6gzH7F3PjzA7Q

    Joined:
    Jan 19, 2021
    Posts:
    2