Button
An interactive tappable element that fires script events when pressed.
Introduction
Button is the primary interactive UI element: players tap it and your scripts respond. Every menu action, Start Game, Buy, Open Inventory, begins with a Button wired to a script. A button is a combination of an Image (its look), a Text label (its caption), and three touch events. Add it from the UI Editor right panel under Basic → Button .
Properties
Interactable Bool Whether the button can be pressed. Turn it off to gray the button out. Image / Image Color Image, Color Background picture and tint of the button. Disabled Color Color The dimmed color shown while the button is not interactable. Text / Font / ... , The caption uses the same text settings as the Text element. Click Penetrate If on, touches pass through this UI to the UI below it or to the 3D world. Rect Position Vector2 X and Y coordinates of the element on screen, the screen center is (0, 0). Rect Rotation Int Rotation angle of the element. Rect Size Width and height of the element. Rect Scale Scale multiplier on top of the size. When broadcast is received with Event Fires when the UI receives a Broadcast signal from the world (Parameter: Object sender). Property Type What it does
Events
On Click The finger presses AND releases on the same button, the standard "tapped" moment. On Press The instant the finger touches the button, before releasing. On Release The finger lifts off the button. Event Fires when
When to use it
Menu actions: start, retry, open shop, teleport. In-world ability buttons (attack, jump pad, interact). Confirmation dialogs (Yes / No pairs).
Demo
A button changes the UI when clicked. Wiring a button to a script
Notes
Prefer On Click over On Press for actions, it cancels naturally if the player slides their finger off the button.