inject_analog_input
Inject gamepad stick or trigger values into a running PIE session to move or look in headless tests; use hold_seconds for sustained input.
Instructions
Feed an analog axis value (gamepad stick, trigger) to a running PIE session's PlayerController -- how you actually MOVE or LOOK headless, where inject_key_input only does digital keys. NOTE: A single axis sample decays to zero within a tick, so sustained motion needs hold_seconds, which re-injects every tick for that long and then neutralises with a 0.0; it is fire-and-forget and returns immediately. Requires an active PIE session and a genuinely analog key (a digital one is a clean error).
Returns: { injected: bool, key: string, value: number, pie_client_index: int, hold_seconds: number }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Required analog key name, e.g. "Gamepad_LeftX", "Gamepad_LeftTriggerAxis". Rejected with a clean error if the key is not analog. | |
| value | Yes | Required float axis value; roughly -1..1 for sticks, 0..1 for triggers. | |
| hold_seconds | No | Optional float. When > 0, the analog value is re-injected every tick for this many seconds (a single axis sample decays to zero, so sustained motion needs re-feeding), then a final 0.0 is injected to neutralize. Fire-and-forget: returns immediately and the hold runs across the next hold_seconds of PIE. Omit (or 0) for a single sample. | |
| pie_client_index | No | Optional int (default 0). Which PIE client window to target -- 0 is the server/host window in a ListenServer session, 1 the first client. |