on button held
Problem it solves
You want the player to hold the A button for 1 second to charge a heavy attack or open a stubborn door.
What this block does
Detects when a controller button is held down continuously for a specified duration before executing a handler.
The block
Block ID: retro_button_hold
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| button | controller.Button | controller.A | The controller button to monitor. |
| time | number | 500 | Hold threshold in milliseconds before triggering. |
| handler | () => void | Action to run once the button has been held long enough. |
Example
Retro.onButtonHeld(controller.A, 600, function () {
Retro.playRetroSound(Retro.Sounds.PowerCharged)
})Add the extension
Add github:CrzLe0723/RetroFx to your project, or open: Import RetroFx.