Reference API Roblox

Engine API

Website

Related

Reference API Roblox

InputBinding

Defines which hardware binding should trigger the parent InputAction.

Member index 19

HistoryMember
726Backward: KeyCode
726ClampMagnitudeToOne: bool
726Down: KeyCode
726Forward: KeyCode
726KeyCode: KeyCode
726Left: KeyCode
726PointerIndex: int
726PressedThreshold: float
726PrimaryModifier: KeyCode
726ReleasedThreshold: float
726ResponseCurve: float
726Right: KeyCode
726Scale: float
726SecondaryModifier: KeyCode
726UIButton: GuiButton
726UIModifier: GuiButton
726Up: KeyCode
726Vector2Scale: Vector2
726Vector3Scale: Vector3
inherited from Instance
726Archivable: bool
726Capabilities: SecurityCapabilities
726IsInSandbox: bool
726Name: string
726Parent: Instance
726PredictionMode: PredictionMode
726Sandboxed: bool
726UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
726children(): Instances
726clone(): Instance
726destroy(): null
726findFirstChild(name: string, recursive: bool = false): Instance
726getChildren(): Instances
726isDescendantOf(ancestor: Instance): bool
726remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
726childAdded(child: Instance)
inherited from Object
726ClassName: string
726className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
726isA(className: string): bool
647Changed(property: string)

Description

An InputBinding defines which hardware binding should trigger the parent InputAction, for example a key press, gamepad button, or tap on a touch‑enabled device. There can be multiple InputBinding instances parented to an InputAction.

History 45

Members 19

Backward

TypeDefault
KeyCode

Specifies an alternate KeyCode for dispatching directionally "backward" inputs to GetState() and the StateChanged event of the parent InputAction. Only applies when the parent action's Type is Direction3D, in which case the dispatched value will be a Vector3 with its Z component between 0 and 1.

History 2

ClampMagnitudeToOne

TypeDefault
bool

Determines whether the binding normalizes the combined composite directional vector to a maximum magnitude of 1 only if it exceeds that length. This prevents diagonal composite inputs (for example Up and Right pressed simultaneously) from producing a magnitude greater than 1, ensuring consistent movement speed regardless of the keys held. Default is true.

This property only applies when the parent action's Type is Direction1D, Direction2D, or Direction3D.

History 2

Down

TypeDefault
KeyCode

Specifies an alternate KeyCode for dispatching directionally "down" inputs to GetState() and the StateChanged event of the parent InputAction.

When the parent action's Type is Direction1D, the dispatched value will be a number between 0 and -1.

When the parent action's Type is Direction2D, the dispatched value will be a Vector2 with its Y component between 0 and -1.

When the parent action's Type is Direction3D, the dispatched value will be a Vector3 with its Y component between 0 and -1.

Not applicable when the parent action's Type is Bool.

History 2

Forward

TypeDefault
KeyCode

Specifies an alternate KeyCode for dispatching directionally "forward" inputs to GetState() and the StateChanged event of the parent InputAction. Only applies when the parent action's Type is Direction3D, in which case the dispatched value will be a Vector3 with its Z component between 0 and -1.

History 2

KeyCode

TypeDefault
KeyCode

Specifies the KeyCode which triggers the parent InputAction. The code type should match the input action's Type, for example KeyCode.E for an action type of Bool or KeyCode.Thumbstick1 for an action type of Direction2D. Type mismatches will either not fire the InputAction or the StateChanged event will receive a converted value.

History 3

Left

TypeDefault
KeyCode

Specifies an alternate KeyCode for dispatching directionally "left" inputs to GetState() and the StateChanged event of the parent InputAction.

When the parent action's Type is Direction2D, the dispatched value will be a Vector2 with its X component between 0 and -1.

When the parent action's Type is Direction3D, the dispatched value will be a Vector3 with its X component between 0 and -1.

Not applicable when the parent action's Type is Direction1D or Bool.

History 2

PointerIndex

TypeDefault
int

History 4

PressedThreshold

TypeDefault
float

Numerical value above which to fire an InputAction with a Type of Bool, for example when a gamepad trigger such as KeyCode.ButtonL2 exceeds 0.5 (halfway pressed). Default is 0.5.

This property must be greater than or equal to ReleasedThreshold or else it will be clamped to ReleasedThreshold.

History 2

PrimaryModifier

TypeDefault
KeyCode

Specifies a KeyCode that serves as a required modifier for the binding. The InputBinding will only trigger the parent InputAction if this input is pressed prior to KeyCode, UIButton, or composite directions.

There is no ordering requirement between PrimaryModifier and SecondaryModifier. If both properties are set, both modifiers must be pressed to activate the binding, but the order in which they are pressed does not matter.

If set to KeyCode.Unknown, no primary modifier is required.

History 2

ReleasedThreshold

TypeDefault
float

Numerical value below which to fire an InputAction with a Type of Bool, for example when a gamepad trigger such as KeyCode.ButtonL2 falls below 0.5 (less than halfway pressed). Default is 0.2.

This property must be less than or equal to PressedThreshold or else it will be clamped to PressedThreshold.

History 2

ResponseCurve

TypeDefault
float

A numerical value to control the sensitivity of gamepad thumbstick input by applying a quadratic response curve. Commonly used for camera control to make small thumbstick inputs more precise, while ramping up quickly to allow for large movements with higher magnitude input.

Ranges between 1 to 10, with higher values providing a more intense curve. Default is 1, at which input is returned exactly as received.

Only applicable when the parent action's Type is Direction2D and the KeyCode is Thumbstick1 or Thumbstick2.

History 2

Right

TypeDefault
KeyCode

Specifies an alternate KeyCode for dispatching directionally "right" inputs to GetState() and the StateChanged event of the parent InputAction.

When the parent action's Type is Direction2D, the dispatched value will be a Vector2 with its X component between 0 and 1.

When the parent action's Type is Direction3D, the dispatched value will be a Vector3 with its X component between 0 and 1.

Not applicable when the parent action's Type is Direction1D or Bool.

History 2

Scale

TypeDefault
float

A scalar multiplier applied uniformly to every component of the output value. Applies to InputAction types Direction1D, Direction2D, and Direction3D.

To scale individual components independently, use Vector2Scale (for Direction2D) or Vector3Scale (for Direction3D). When both Scale and a vector scale are set, both are applied.

History 3

SecondaryModifier

TypeDefault
KeyCode

Specifies a KeyCode that serves as a required modifier for the binding. The InputBinding will only trigger the parent InputAction if this input is pressed prior to KeyCode, UIButton, or composite directions.

There is no ordering requirement between PrimaryModifier and SecondaryModifier. If both properties are set, both modifiers must be pressed to activate the binding, but the order in which they are pressed does not matter.

If set to KeyCode.Unknown, no secondary modifier is required.

History 2

UIButton

TypeDefault
GuiButton

GuiButton to connect to a boolean action.

History 3

UIModifier

TypeDefault
GuiButton

Specifies a GuiButton that must be pressed for the InputBinding to trigger the parent InputAction. Behaves similarly to PrimaryModifier and SecondaryModifier, but accepts a UI button reference rather than a KeyCode.

If nil, no modifier is required.

History 2

Up

TypeDefault
KeyCode

Specifies an alternate KeyCode for dispatching directionally "up" inputs to GetState() and the StateChanged event of the parent InputAction.

When the parent action's Type is Direction1D, the dispatched value will be a number between 0 and 1.

When the parent action's Type is Direction2D, the dispatched value will be a Vector2 with its Y component between 0 and 1.

When the parent action's Type is Direction3D, the dispatched value will be a Vector3 with its Y component between 0 and 1.

Not applicable when the parent action's Type is Bool.

History 2

Vector2Scale

TypeDefault
Vector2

Amount by which each component of the output is independently linearly scaled. Only applies when the parent action's Type is Direction2D.

History 2

Vector3Scale

TypeDefault
Vector3

Amount by which each component of the output is independently linearly scaled. Only applies when the parent action's Type is Direction3D.

History 2

Settings