Search Unity

Tap detection...someone show me the light

Discussion in 'Scripting' started by CTS1234, Sep 12, 2019.

  1. CTS1234

    CTS1234

    Joined:
    Aug 21, 2019
    Posts:
    3
    Hi, im new to unity and im trying to figure out how to tap an object in AR and cause a UI element to appear on screen. there are three objects so each object would trigger a different UI element to pop up.

    If anyone can give me any advice in how to achieve this, id be very grateful.

    Thanks
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    This is super basic stuff, have you tried going through unity tutorials on the learn part of the website?

    https://unity.com/learn

    If you go through a number of tutorials on there youll know how to do this.

    Its as simple as reading the input, raycasting from input location into the scene ( doing a space transformation as it needs to go from screen into world space), getting the object tapped, and then triggering some code to show the UI element relevant to that asset. That could just be a gameobject variable that you enable / disable in the scene.
     
  3. CTS1234

    CTS1234

    Joined:
    Aug 21, 2019
    Posts:
    3
    excellent, thanks for the direction
     
    palex-nx and MadeFromPolygons like this.