> For the complete documentation index, see [llms.txt](https://docs.overthereality.ai/over-sdk-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overthereality.ai/over-sdk-manual/sdk-coding-nodes/over-nodes/touch-and-click-events.md). Agents can also search and read this documentation through its [MCP server](https://docs.overthereality.ai/over-sdk-manual/~gitbook/mcp).

# Touch & Click Events

These event nodes fire when the user touches the screen of the device. You find them in the fuzzy finder under **Events > OVER**.

<figure><img src="https://123660717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xdubHTzJACGqFIM7yJy%2Fuploads%2FUTUEtMFdMNT3fOkZv2rW%2Fnode-touch-events.png?alt=media&amp;token=ad77bd64-3c4e-4d50-a3c0-cdd66dfeb7be" alt="One Touch In Event, Two Touches In Event and Click On Screen Event nodes"><figcaption></figcaption></figure>

**How to read the names**

* **One Touch** : one finger on the screen. **Two Touches** : two fingers, for example for pinch or rotate gestures.
* **Enter** : the finger touches the screen. **In** : the finger stays on the screen. **Exit** : the finger leaves the screen.
* **Over UI** : only when the touch is on a UI element (button, panel...). **Not Over UI** : only when it is not. Without these words the event fires in both cases.
* **Click** : a short tap. **Double Click** : two quick taps in the same place.

## One Touch events

| Node                              | Outputs      |
| --------------------------------- | ------------ |
| One Touch Enter Event             | New 0        |
| One Touch Enter Over UI Event     | New 0        |
| One Touch Enter Not Over UI Event | New 0        |
| One Touch In Event                | Old 0, New 0 |
| One Touch In Over UI Event        | Old 0, New 0 |
| One Touch In Not Over UI Event    | Old 0, New 0 |
| One Touch Exit Event              | Old 0        |

## Two Touches events

| Node                                | Outputs                    |
| ----------------------------------- | -------------------------- |
| Two Touches Enter Event             | New 0, New 1               |
| Two Touches Enter Over UI Event     | New 0, New 1               |
| Two Touches Enter Not Over UI Event | New 0, New 1               |
| Two Touches In Event                | Old 0, Old 1, New 0, New 1 |
| Two Touches In Over UI Event        | Old 0, Old 1, New 0, New 1 |
| Two Touches In Not Over UI Event    | Old 0, Old 1, New 0, New 1 |
| Two Touches Exit Event              | Old 0, Old 1               |

* **New 0**, **New 1 (Vector2)** : the current screen position of the first and second finger, in pixels.
* **Old 0**, **Old 1 (Vector2)** : the previous screen position of the fingers. Subtract **Old** from **New** to know how much a finger moved.

## Click events

| Node                                | Outputs               |
| ----------------------------------- | --------------------- |
| Click On Screen Event               | Raycast Hit, Position |
| Click On Not UI Screen Event        | Raycast Hit, Position |
| Double Click On Screen Event        | Raycast Hit, Position |
| Double Click On Not UI Screen Event | Raycast Hit, Position |

* **Raycast Hit (RaycastHit)** : the 3D object under the finger. Only objects with a **Collider** are found. Use **RaycastHit Get Collider** or **Get Transform** to read it.
* **Position (Vector2)** : the screen position of the tap, in pixels.

**Use Cases**

* Select or move a 3D object when the user taps on it (**Click On Not UI Screen Event**).
* Rotate or scale an object with two fingers (**Two Touches In Not Over UI Event**).
* Ignore touches on buttons, so the scene does not react when the user presses the UI.

## Testing in the Unity Editor

* **Click events** : in Play mode, with the **OVER\_PlayerSimulator** in the scene, press the **left mouse button** to tap and double-click to double tap.
* **All touch events** : select **OVER\_Asset** and, in the **Over App Event Listeners** component, choose the event, set the positions and press **Trigger Event**.
