When Pressed for a While
Fires when the player keeps holding this UI object for the hold time.
Introduction
When Pressed for a While is an event in the UI group of UI Events. It fires when the player keeps holding this UI object for the hold time. When it fires, the event hands one value to your script: the Current Position where the hold is happening. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. Holding is a different intent from tapping: use this event for long-press actions like opening a context menu, and combine it with When Pressed , When Released , and When Tapped so every gesture duration has its own response. Drags during the hold are tracked by When Touch Move . The UI List & UI Editor Mode guide shows where these event blocks attach in the editor. When Pressed for a While event in the UI Editor Image The When Pressed for a While event in the UI Editor. caption When Pressed for a While, Fires when the player holds the UI panel pressed for a while (long press). This event belongs to the "UI" group in UI Events. Trigger: fired by player. Event outputs: Current Position.
Parameters
Current Position where the finger or cursor is on the UI object right now Parameter Description
How to Access
How to Access - When Pressed for a While
Example
When Pressed for a While event with an unlock action when-pressed-for-a-while-example.webp Example: holding the object down stops the background music. caption
How to Use
Open the UI Editor and press the UI Property button (the document icon in the top toolbar) without selecting any element, the UI Base panel opens on the right. In the panel's Event Triggers section, find When Pressed for a While and press Scripts + next to it, then add the actions that should run when the event fires: what should run after the hold time passes, such as revealing a hidden option. Tell players a hold is needed, for example with a filling progress ring. Press Play and hold the panel down to confirm the event fires only after the hold time.
Common Uses
Secret menus and easter eggs Delete or reset confirmations Extra actions beyond a simple tap
Tip
A visible hold indicator, like a ring that fills up, tells players the hold is intentional instead of a stuck touch.