Search Unity

How to touch Object then show information panel in AR

Discussion in 'AR' started by AlifiaSals17, Jun 8, 2020.

  1. AlifiaSals17

    AlifiaSals17

    Joined:
    May 2, 2020
    Posts:
    2
    Hi everyone,

    I'm just started to learn ar with vuforia in
    unity and i get some trouble when i want to make my 3d object clickable and it will show information panel.
    This is my ar hierarchy. The blue pointer is my information panel about the object. While 3d object in "sistempernapasan". In this case, i want to try click "kepala" object and it will show "PanelHidung" in Canvas.
    View attachment 638036

    Then, i try to add box collider component to "kepala"
    View attachment 638039

    And here is my script for Show Panel
    View attachment 638042
    I didn't get any error message but it can run properly when i tested via webcam. My 3d object cannot be clicked and it don't show the panel. I'm sorry if it poor question.
    I'd really appreciate any help from you guys.
    Thank you :)
     
  2. gtramnull

    gtramnull

    Joined:
    Apr 23, 2020
    Posts:
    5
    Not sure if you've already tried this but you might look into using Raycast? Say you have a prefab in front of the camera then you get the raycast from touch into the world and see if hits something. If it does then check what object it is, so on and so forth.