crystal.input.is_action_down

Returns whether any input mapped to a specific action is currently being pressed.

Usage

crystal.input.is_action_down(player_index, action)

Arguments

Name Type Description
player_index number Number identifying a player.
action string Action whose current state to check.

Returns

Name Type Description
down boolean True if an input mapped to this action is being pressed, false otherwise.

Examples

crystal.input.set_bindings(1, { space = { "jump" } });
print(crystal.input.is_action_active("jump")); -- Prints "false"

This site uses Just the Docs, a documentation theme for Jekyll.