# Cooking with Clicks: Mastering Over Clickable Objects in AR

{% hint style="info" %}
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.
{% endhint %}

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.

<figure><img src="https://123660717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xdubHTzJACGqFIM7yJy%2Fuploads%2Fk0TvldKEwpKSAEETr9gO%2Fimage.png?alt=media&#x26;token=ea0a9ba5-9679-4196-bf9a-c7cb50a23110" alt=""><figcaption></figcaption></figure>

* **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`).

<figure><img src="https://123660717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xdubHTzJACGqFIM7yJy%2Fuploads%2FgOxv3LhcaLH4y4uCLla2%2Fimage.png?alt=media&#x26;token=25afdbf7-b3c1-41e4-8949-95a5c95713a7" alt="" width="113"><figcaption></figcaption></figure>

* **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`).

<figure><img src="https://123660717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xdubHTzJACGqFIM7yJy%2Fuploads%2FG2PFFaoRBELLAdCn3C8o%2Fimage.png?alt=media&#x26;token=dc731d01-2ab7-4287-9402-5390c3148683" alt=""><figcaption></figcaption></figure>

* **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.

<br>
