Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

holdInput

holdInput<Value>(headlessGame, handle, value): void

Holds handle at value in what every step from here reads, as a player holding a key does: a button held or let go, an axis, a vector or an angle at the step nearest the value. An edge button, such as characters.inputs.jump, is pressed once: the next step takes it. A button’s press and its let-go each reach the next step’s changes too, as readInputChanges reads them. holdInput(game, characters.inputs.move, { x: 0, y: 1 }) walks the character forward.

Type Parameter
Value extends InputValue
Parameter Type
headlessGame Pick<HeadlessGame, "world" | "input">
handle InputHandle<Value>
value Value

void