Cooking with Clicks: Mastering Over Clickable Objects in AR

The 'UVS' in OverClickableObjectUVS stands for Unity Visual Scripting , distinguishing it from the older, The OverClickableObjectUVS component includes 'UVS' in its name, which stands for Unity Visual Scripting , distinguishing it from the older, legacy implementation. This naming convention ensures clarity and helps users identify the correct component for modern workflows.

The OverClickableObjectUVS is a scriptable component that detects user interactions on 3D objects and communicates these interactions to your Visual Scripting graph . It supports three core interaction types:

  • Click : Triggered when the user taps or clicks the object briefly.

  • Press : Triggered when the user presses and holds the object.

  • Long Press : Triggered when the user holds the object for an extended duration.

These interactions are sent as events to your visual scripting graph, where you can define custom behaviors such as animations, sound effects, UI updates, or other gameplay mechanics.

How to Use

  • To make a 3D object interactive:

    • Select the 3D object in the Unity Hierarchy.

    • Click Add Component in the Inspector panel and search for OverClickableObjectUVS .

    • Alternatively, right-click in the Hierarchy, navigate to OVER > Preset > OVER_ClickableObject , and add it directly.

  • Set Up Visual Scripting

    • Add or modify a Visual Scripting graph in Unity:

      • Right-click in the Hierarchy and navigate to OVER > Unity Visual Scripting > Graph to create a new graph, or modify an existing one.

    • Add a UnityEvent node for each needed interaction type (e.g., click, press, longPress).

  • Configure the Component

    • In the Inspector panel , configure the properties of the OverClickableObjectUVS :

      • Attach the Visual Scripting graph where the UnityEvent nodes are defined.

      • For each event, select the function Script Machine > TriggerUnityEvent and set the corresponding event name (e.g., OnClick, OnPress, OnLongPress).

  • Test in Play Mode

    • In Play Mode , simulate interactions by selecting the desired event in the Inspector .

    • Press the "Trigger Event" button to test how the object responds to clicks, presses, or long presses.

Last updated