When Pressed
Fires when the player grabs the joystick and starts steering it.
Introduction
When Pressed is an event in the Joystick group of UI Events. It fires when the player grabs the joystick and starts steering it. When it fires, the event hands the player to your script, so you know exactly who interacted. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. The joystick reports three moments: this event when the thumb touches down, When Dragged for every direction change while moving, and When Release when the thumb lets go. Build the element itself with the UI Joystick guide, and for plain taps outside the joystick use When Tapped . When Pressed event in the UI Editor Image The When Pressed event in the UI Editor. caption When Joystick is Pressed, Fires when the player presses down on the joystick. This event belongs to the "Joystick" group in UI Events. Trigger: fired by player.
Parameters
Player the player who grabbed the joystick Parameter Description
How to Access
How to Access - When Joystick Pressed
How to Use
Select the joystick element and open its properties, then find its component block. Check that the When Pressed event is listed in the block; if it is hidden, press the three dots (...) at the top right of the block and check it in the pop-up list. Press Scripts + next to When Pressed , then add the actions that should run when the event fires: what should run the moment the joystick is grabbed, such as showing its active visuals. Pair it with When Released to clean up when the player lets go. Press Play and grab the joystick to confirm the event fires on the grab.
Example
Example: the joystick lights up with a sound the moment the player grabs it.
Common Uses
Show active visuals while steering Start movement related logic Play grab feedback sounds
Tip
The joystick also has When Dragged for steering updates. Pressed fires once on the grab, Dragged keeps firing while steering.