Skip to content

Controller.getController()

jackcarey edited this page Jul 16, 2022 · 1 revision

Gets a gamepad by it's index.

Returns: A Controller instance.

The Controller.getController() method takes an index and returns a reference to the gamepad at that index. If no gamepad is found at the index, it returns undefined.

Arguments

Controller.getController(index)

Argument Type Description
index Int A controller index.

Example

Controller.getController(0);

>> Controller {}
Clone this wiki locally