OVER_ClickableObject
The OVER_ClickableObject preset creates an interactive object in Unity, consisting of a cube and the OverClickableObjectUVS script. This preset is designed to simplify the implementation of touch or click-based interactions in your scene.
The OverClickableObjectUVS script attached to the cube allows the object to respond to user interactions such as click , press , and long press . These interactions are exposed through Unity’s UnityEvent system, enabling you to define custom behaviors directly in the Inspector or manage them using Unity Visual Scripting .

The script provides three main interaction events
Click : Triggered when the user taps or clicks on the object.
Press : Triggered when the user presses down on the object.
Long Press : Triggered when the user holds their touch or click for an extended duration.

The script integrates seamlessly with Unity Visual Scripting , enabling you to visually design complex interaction logic without writing code. While the preset includes a default cube as an example, you can easily replace it with any 3D model to suit your project’s needs.

Simulate Events in the Inspector
To help you test and debug your interactions, the OverClickableObjectUVS script includes a Simulate section in the Inspector. This feature allows you to manually trigger the events without needing to interact with the object in Play Mode:
Select the event you want to simulate (Click , Press , or Long Press ) from the dropdown menu.
Press the Trigger Event button to simulate the selected event and observe how your custom behaviors respond in the Unity Editor.
This simulation capability is particularly useful during development, as it saves time by allowing you to test your interactions without relying on physical input devices or running the application on a target platform.

Last updated