What it does
Returns the current value of an input action.
Syntax
ActionValue(action string) → floatParameters
| Name | Type | Meaning |
|---|---|---|
| action | string | The 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()LOOPActionValue 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.