Controller

Show Deprecated
Not Creatable

The base class for controller objects, such as the HumanoidController object.

Summary

Methods

Events

Properties

Methods

BindButton

()

Activates an overriding bind on the specified button.

Parameters

button: Enum.Button
caption: string

Returns

()

Code Samples

The example below when placed inside a LocalScript, would result in a GUI saying "Press Backspace to win!".

Controller:BindButton1

local ControllerService = game:GetService("ControllerService")
local humanoidController = ControllerService:FindFirstChildOfClass("HumanoidController")
humanoidController:BindButton(Enum.Button.Dismount, "win!")

GetButton

Returns whether or not Button is being pressed.

Parameters

button: Enum.Button

Returns

UnbindButton

()

Removes the bind on button.

Parameters

button: Enum.Button

Returns

()

Events

ButtonChanged

Fired when the pressed state of a bound button is changed. This event can be used in conjunction with Controller:GetButton() to see whether a bound button is being pressed down or not.

Parameters

button: Enum.Button