16 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

InputBinding

Inherits from: Instance → Object

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.

Inherits from: Instance

Memory category: Instances

Properties

NameType / ReturnsDescription
InputBinding.BackwardKeyCodeSpecifies an alternate KeyCode for dispatching directionally "backward" inputs to the parent InputAction.
InputBinding.ClampMagnitudeToOnebooleanSpecifies how the binding normalizes composite directional input to a maximum magnitude of 1.
InputBinding.DisplayImageContentCustom image asset to display for this binding.
InputBinding.DisplayNamestringCustom display text for this binding.
InputBinding.DownKeyCodeSpecifies an alternate KeyCode for dispatching directionally "down" inputs to the parent InputAction.
InputBinding.ForwardKeyCodeSpecifies an alternate KeyCode for dispatching directionally "forward" inputs to the parent InputAction.
InputBinding.KeyCodeKeyCodeSpecifies the KeyCode which triggers the parent InputAction.
InputBinding.LeftKeyCodeSpecifies an alternate KeyCode for dispatching directionally "left" inputs to the parent InputAction.
InputBinding.PointerIndexint
InputBinding.PressedThresholdfloatNumerical value above which to fire an InputAction with a Type of Bool.
InputBinding.PrimaryModifierKeyCodeSpecifies a primary KeyCode that must be pressed for the binding to activate.
InputBinding.ReleasedThresholdfloatNumerical value below which to fire an InputAction with a Type of Bool.
InputBinding.ResponseCurvefloatNumerical value to configure scaling for more precise thumbstick aiming.
InputBinding.RightKeyCodeSpecifies an alternate KeyCode for dispatching directionally "right" inputs to the parent InputAction.
InputBinding.ScalefloatScalar multiplier applied uniformly to all components of a directional InputAction's output.
InputBinding.SecondaryModifierKeyCodeSpecifies a secondary KeyCode that must be pressed for the binding to activate.
InputBinding.TypeInputBindingTypeDetermines whether this binding is triggered by hardware input or programmatically via Fire().
InputBinding.UIButtonGuiButtonConnects a GuiButton to a boolean action.
InputBinding.UIModifierGuiButtonSpecifies a GuiButton that must be active for the binding to activate.
InputBinding.UpKeyCodeSpecifies an alternate KeyCode for dispatching directionally "up" inputs to the parent InputAction.
InputBinding.Vector2ScaleVector2Per-component scale applied to the output of a Direction2D action.
InputBinding.Vector3ScaleVector3Per-component scale applied to the output of a Direction3D action.

Inherited from Instance

NameType / ReturnsDescription
Instance.ArchivablebooleanDetermines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published.
Instance.archivableboolean
Instance.CapabilitiesSecurityCapabilitiesThe set of capabilities allowed to be used for scripts inside this container.
Instance.IsInSandboxbooleanIndicates whether the instance is inside a sandboxed container.
Instance.NamestringA non-unique identifier of the Instance.
Instance.ParentInstanceDetermines the hierarchical parent of the Instance.
Instance.PredictionModePredictionModeReflects the client-side prediction mode applied to the instance under server-authoritative physics.
Instance.RobloxLockedbooleanA deprecated property that used to protect CoreGui objects.
Instance.SandboxedbooleanWhen enabled, the instance can only access abilities in its Capabilities list.
Instance.UniqueIdUniqueIdA unique identifier for the instance.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

InputBinding.Backward

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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryComposite Directions
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.ClampMagnitudeToOne

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.

Set this to false when input axes should remain independent of one another, such as 3D freecam movement, or when combining inputs whose raw values can exceed 1 (for example mouse wheel velocity) and you want to handle scaling yourself.

FieldValue
typeboolean
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryComposite Directions
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.DisplayImage

A custom Content image asset that represents this binding visually (for example a gamepad button image or a stylized key graphic).

When empty (the default), no custom image is provided. Developers can use UserInputService:GetImageForKeyCode() to obtain a platform-appropriate image. Use this together with InputAction.PreferredBinding to build keybinding UI that automatically reflects the player's active input device without manually resolving which binding image to display.

FieldValue
typeContent
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryDisplay
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.DisplayName

A custom string that overrides the display name shown for this binding in UI elements such as key prompts (for example "FIGHT" instead of the default key name "F").

When empty (the default), no custom name is provided. Developers can use UserInputService:GetStringForKeyCode() to obtain the platform-appropriate key name. Use this together with InputAction.PreferredBinding to build keybinding UI that automatically reflects the player's active input device without manually resolving which binding name to display.

FieldValue
typestring
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryDisplay
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Down

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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryComposite Directions
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Forward

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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryComposite Directions
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Left

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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryComposite Directions
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.PointerIndex

FieldValue
typeint
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.PressedThreshold

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.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.PrimaryModifier

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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.ReleasedThreshold

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.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.ResponseCurve

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.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Right

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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryComposite Directions
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Scale

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.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.SecondaryModifier

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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Type

Determines whether this InputBinding is triggered by hardware input (Automatic) or programmatically via Fire() (Scriptable).

When set to Automatic (default), the binding responds to physical input devices (keyboard, mouse, gamepad, touch) based on its KeyCode or composite direction or UI button properties.

When set to Scriptable, the binding ignores hardware input and instead receives state updates exclusively through the Fire() method.

FieldValue
typeInputBindingType
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.UIButton

GuiButton to connect to a boolean action.

FieldValue
typeGuiButton
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.UIModifier

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.

This is particularly useful for touch input where the relevant interaction is defined by where on screen the touch originates, for example a dynamic thumbstick that should only respond to touches that begin within a specific UI region.

If nil, no modifier is required.

FieldValue
typeGuiButton
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Up

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.

FieldValue
typeKeyCode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryComposite Directions
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Vector2Scale

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

FieldValue
typeVector2
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

InputBinding.Vector3Scale

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

FieldValue
typeVector3
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":true,"can_save":true}
capabilities["Input"]

Methods

NameType / ReturnsDescription
InputBinding:Fire()Programmatically updates the parent InputAction state through this binding.

Inherited from Instance

NameType / ReturnsDescription
Instance:AddTag()Applies a tag to the instance.
Instance:childrenInstancesReturns an array of the object's children.
Instance:ClearAllChildren()This method destroys all of an instance's children.
Instance:CloneInstanceCreate a copy of an instance and all its descendants, ignoring instances that are not Archivable.
Instance:cloneInstance
Instance:Destroy()Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children.
Instance:destroy()
Instance:FindFirstAncestorInstance?Returns the first ancestor of the Instance whose Instance.Name is equal to the given name.
Instance:FindFirstAncestorOfClassInstance?Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className.
Instance:FindFirstAncestorWhichIsAInstance?Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstChildInstance?Returns the first child of the Instance found with the given name.
Instance:findFirstChildInstance
Instance:FindFirstChildOfClassInstance?Returns the first child of the Instance whose ClassName is equal to the given class name.
Instance:FindFirstChildWhichIsAInstance?Returns the first child of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstDescendantInstance?Returns the first descendant found with the given Instance.Name.
Instance:GetActorActor?Returns the Actor associated with the Instance, if any.
Instance:GetAttributeVariantReturns the value which has been assigned to the given attribute name.
Instance:GetAttributeChangedSignalRBXScriptSignalReturns an event that fires when the given attribute changes.
Instance:GetAttributesDictionaryReturns a dictionary of the instance's attributes.
Instance:GetChildrenInstancesReturns an array containing all of the instance's children.
Instance:getChildrenInstances
Instance:GetDebugIdstringReturns a coded string of the debug ID used internally by Roblox.
Instance:GetDescendantsInstancesReturns an array containing all of the descendants of the instance.
Instance:GetFullNamestringReturns a string describing the instance's ancestry.
Instance:GetStyledVariantReturns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
Instance:GetStyledPropertyChangedSignalRBXScriptSignalReturns an event that fires when the given style property changes on the instance.
Instance:GetTagsArrayGets an array of all tags applied to the instance.
Instance:HasTagbooleanCheck whether the instance has a given tag.
Instance:IsAncestorOfbooleanReturns true if an Instance is an ancestor of the given descendant.
Instance:IsDescendantOfbooleanReturns true if an Instance is a descendant of the given ancestor.
Instance:isDescendantOfboolean
Instance:IsPropertyModifiedbooleanReturns true if the value stored in the specified property is not equal to the code-instantiated default.
Instance:QueryDescendantsInstancesReturns an array containing all descendants of the instance that match the selector string.
Instance:Remove()Sets the object's Parent to nil, and does the same for all its descendants.
Instance:remove()
Instance:RemoveTag()Removes a tag from the instance.
Instance:ResetPropertyToDefault()Resets a property to its default value.
Instance:SetAttribute()Sets the attribute with the given name to the given value.
Instance:WaitForChildInstanceReturns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

Inherited from Object

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

InputBinding:Fire

Programmatically updates the parent InputAction to the given state and fires the appropriate signals (Pressed, Released, StateChanged).

This method can only be called on bindings with Type set to Scriptable. Calling it on an Automatic binding will throw an error.

The state parameter must match the Type of the parent InputAction:

Passing a mismatched type will cause an error. This method respects the same deduplication rules as hardware input, as in consecutive calls with the same state value will not re‑fire events.

The parent InputAction must be Enabled and its ancestor InputContext must also be Enabled, otherwise the call is silently ignored.

Parameters

NameTypeDefaultDescription
stateVariantThe state value to apply; must match the parent action's Type.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Input"]
simulationAccesstrue

Events

Inherited from Instance

NameType / ReturnsDescription
Instance.AncestryChangedFires when the Instance.Parent property of this object or one of its ancestors is changed.
Instance.AttributeChangedFires whenever an attribute is changed on the Instance.
Instance.ChildAddedFires after an object is parented to this Instance.
Instance.childAdded
Instance.ChildRemovedFires after a child is removed from this Instance.
Instance.DescendantAddedFires after a descendant is added to the Instance.
Instance.DescendantRemovingFires immediately before a descendant of the Instance is removed.
Instance.DestroyingFires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy().
Instance.StyledPropertiesChangedFires whenever any style property is changed on the instance, including when a property is set to nil.

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.