Run Conditions
Run conditions gate a system on global action state. They require InputManagerPlugin to be configured with globalMap.
import { ActionPressed, ActionJustPressed, ActionJustReleased } from '@shell/input-manager';
const JumpSystem = Define.system() .runIf(ActionJustPressed('jump')) .update(() => { // runs only on the frame jump was pressed });Conditions
Section titled “Conditions”| Condition | Description |
|---|---|
ActionPressed(action) | true while the action is held |
ActionJustPressed(action) | true for one frame on press |
ActionJustReleased(action) | true for one frame on release |
Each condition reads from the actionState resource updated by GlobalInputSystem.