Controller

Show Deprecated
Not Creatable

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

Summary

Properties

Events


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.

Methods

BindButton(button: Button, caption: string): void  

Activates an overriding bind on the specified button.

GetButton(button: Button): boolean  

Returns whether or not Button is being pressed.

UnbindButton(button: Button): void  

Removes the bind on button.

Properties

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: Button

Methods

BindButton

void

Activates an overriding bind on the specified button.

Parameters

button: Button
caption: string

Returns

void

Code Samples

Controller:BindButton1

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

GetButton

Returns whether or not Button is being pressed.

Parameters

button: Button

Returns

UnbindButton

void

Removes the bind on button.

Parameters

button: Button

Returns

void