Referencia de triggers
35 triggers. Los mismos nombres funcionan en tres sitios: el trigger de un evento, el nodo de evento de un patch y ctx.on(...) en un script.
Un trigger con ramas mantiene una lista de steps por resultado, de modo que un solo evento los cubre todos — ver Eventos.
| En el editor | Categoría | Ramas | Id (scripts, patches) |
|---|---|---|---|
| Game controls | control | idle, move, jump, run | on-game-control |
| UI action | external | — | on-divkit-action |
| Signal | external | — | on-signal |
| Variable change | external | — | on-variable-change |
| Hover out | input | — | on-blur |
| Click | input | — | on-click |
| Double click | input | — | on-double-click |
| Drag | input | — | on-drag |
| Hover | input | enter, exit | on-hover |
| Key | input | down, up | on-key |
| Long press | input | — | on-long-press |
| Press on the object | input | click, down, up | on-mouse |
| Pinch | input | — | on-pinch |
| Pointer lock | input | — | on-pointer-lock |
| Cursor move | input | — | on-pointer-move |
| Rotate | input | — | on-rotate |
| Scroll | input | — | on-scroll |
| Launch | lifecycle | — | on-launch |
| Pause | lifecycle | — | on-pause |
| Resize | lifecycle | — | on-resize |
| Resume | lifecycle | — | on-resume |
| Visibility | lifecycle | show, hide | on-visibility |
| Collision | physics | — | on-collide |
| Distance | proximity | enter, exit | on-distance |
| State active | state | — | on-state-active |
| State inactive | state | — | on-state-inactive |
| Every N seconds | time | — | on-interval |
| Delay | time | — | on-timeout |
| Detect | tracking | — | on-detect |
| Tracking lost | tracking | — | on-lost |
| Placed | tracking | — | on-placed |
| VPS error | tracking | — | on-vps-error |
| VPS localized | tracking | — | on-vps-localized |
| VPS localization failed | tracking | — | on-vps-not-localized |
| VPS ready | tracking | — | on-vps-ready |
Parámetros
Game controls
Id: on-game-control
Categoría control · ramas idle, move, jump, run
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
mode | select | "walk" | walk, fly, top_down |
turnToMove | boolean | true | Auto-orient |
towards | select | "camera" | camera, axis |
cameraRelative | boolean | true | Camera relative |
speed | number | 3 | Pos. Speed |
runMultiplier | number | 2 | Run Factor |
turnSpeed | number | 720 | Rot. Speed |
posDelayIn | number | 0 | Pos. Delay |
posDelayOut | number | 0 | |
rotDelayIn | number | 0 | Rot. Delay |
rotDelayOut | number | 0 | |
scheme | select | "both" | wasd, arrows, both |
rotateBy | select | "mouse" | mouse, keys, both |
touch | boolean | true | Touch controls |
touchRotateBy | select | "drag" | drag, joystick |
stickCorner | select | "bottom_left" | top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right |
jumpCorner | select | "bottom_right" | top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right |
touchOffsetX | number | 30 | Offset |
touchOffsetY | number | 30 | |
buttonSize | number | 120 | Button Size |
touchVisibility | select | "show" | show, hide |
colliderShape | select | "capsule" | capsule, sphere |
colliderRadius | number | 0.5 | Size |
colliderHeight | number | 1.8 | |
colliderX | number | 0 | Position |
colliderY | number | 0.9 | |
colliderZ | number | 0 | |
mass | number | 1 | Mass |
colliderHelper | select | "hide" | show, hide |
jumpHeight | number | 0 | Jump |
airControl | number | 0.3 | Air Control |
resetY | number | 0 | Rst Y-offset |
clickToMove | boolean | false | Click To Move |
followCamera | entity | null | Camera |
orientTo | select | "normal" | normal, angle |
camPosDelay | number | 0.12 | Pos. Delay |
camRotDelay | number | 0.08 | Rot. Delay |
upDown | select | "yes" | yes, no, limit |
upDownMin | number | 0 | Limit |
upDownMax | number | 89 | |
leftRight | select | "yes" | yes, no, limit |
leftRightMin | number | -90 | Limit |
leftRightMax | number | 90 |
UI action
Id: on-divkit-action
Categoría external
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
id | string | — | Action id |
Signal
Id: on-signal
Categoría external
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
signal | string | "" | Signal |
Variable change
Id: on-variable-change
Categoría external
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
variable | string | "" | Variable |
Hover out
Id: on-blur
Categoría input
Sin parámetros.
Click
Id: on-click
Categoría input
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Double click
Id: on-double-click
Categoría input · alcance entity
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Drag
Id: on-drag
Categoría input · alcance entity · solo en anchors surface
Sin parámetros.
Hover
Id: on-hover
Categoría input · ramas enter, exit · alcance entity
Sin parámetros.
Key
Id: on-key
Categoría input · ramas down, up
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
code | string | — | Code |
codes | array | [] | Keys |
ctrl | boolean | false | |
alt | boolean | false | |
shift | boolean | false | |
meta | boolean | false | |
double | boolean | false | Double press |
bind | string | "" | Project bind |
alts | array | [] | Alternatives |
ignoreRepeat | boolean | false | Ignore auto-repeat |
Long press
Id: on-long-press
Categoría input · alcance entity
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Press on the object
Id: on-mouse
Categoría input · ramas click, down, up · alcance entity
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
ctrl | boolean | false | |
alt | boolean | false | |
shift | boolean | false | |
meta | boolean | false | |
double | boolean | false | Double press |
bind | string | "" | Project bind |
alts | array | [] | Alternatives |
Pinch
Id: on-pinch
Categoría input · alcance entity · solo en anchors surface
Sin parámetros.
Pointer lock
Id: on-pointer-lock
Categoría input
Sin parámetros.
Cursor move
Id: on-pointer-move
Categoría input
Sin parámetros.
Rotate
Id: on-rotate
Categoría input · alcance entity · solo en anchors surface
Sin parámetros.
Scroll
Id: on-scroll
Categoría input
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
direction | select | "any" | any, up, down |
Launch
Id: on-launch
Categoría lifecycle
Sin parámetros.
Pause
Id: on-pause
Categoría lifecycle
Sin parámetros.
Resize
Id: on-resize
Categoría lifecycle
Sin parámetros.
Resume
Id: on-resume
Categoría lifecycle
Sin parámetros.
Visibility
Id: on-visibility
Categoría lifecycle · ramas show, hide
Sin parámetros.
Collision
Id: on-collide
Categoría physics
Sin parámetros.
Distance
Id: on-distance
Categoría proximity · ramas enter, exit
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
target | entity | null | Other object |
distance | number | 1 | Distance |
fireOnStart | boolean | false | Check at start |
State active
Id: on-state-active
Categoría state · se dispara por state
Sin parámetros.
State inactive
Id: on-state-inactive
Categoría state · se dispara por state
Sin parámetros.
Every N seconds
Id: on-interval
Categoría time
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
seconds | number | 1 | Every |
repeat | number | 0 | Repeat |
Delay
Id: on-timeout
Categoría time
| Parámetro | Tipo | Por defecto | Opciones / etiqueta |
|---|---|---|---|
seconds | number | 1 | After |
Detect
Id: on-detect
Categoría tracking · solo en anchors image, qr, face, surface
Sin parámetros.
Tracking lost
Id: on-lost
Categoría tracking · solo en anchors image, qr, face, surface
Sin parámetros.
Placed
Id: on-placed
Categoría tracking · solo en anchors surface
Sin parámetros.
VPS error
Id: on-vps-error
Categoría tracking · solo en anchors surface
Sin parámetros.
VPS localized
Id: on-vps-localized
Categoría tracking · solo en anchors surface
Sin parámetros.
VPS localization failed
Id: on-vps-not-localized
Categoría tracking · solo en anchors surface
Sin parámetros.
VPS ready
Id: on-vps-ready
Categoría tracking · solo en anchors surface
Sin parámetros.