ActionValue

Family: Studio · One form

What it does

Returns the current value of an input action.

Syntax

ActionValue(action string) → float

Parameters

NameTypeMeaning
actionstringThe action's name, as defined in the editor.

Every form returns

float

From 0 to 1 for a button action, from -1 to 1 for an axis action, and 0 for an unknown action.

Example · generated

DO  Print(ActionValue("value"))  Sync()LOOP

ActionValue is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

133 commands in Studio