object.playerNumber

Type Number
Object InputDevice
Revision 2017.3060
Keywords device, input, playerNumber

Overview

Read-only property which returns the player number assigned to a game controller by the system, such as a Windows' XInput (Xbox) game controller or Android 5.0+ game controller. For Windows XInput game controllers, this number ranges between 1 and 4, typically indicated by a light on the controller. On Android TV and Amazon Fire TV, this number ranges between 1 and 4 as well.

This property will be nil if the InputDevice or system does not support assigning player numbers to a controller, such as HID and DirectInput devices on Windows, or HID devices on macOS.