SetNavigationGamepad
The SetNavigationGamepad function sets whether the specified Enum/UserInputType
gamepad can move the GUI navigator. A gamepad that is allowed to move the GUI navigator is considered a navigation gamepad.
If the enabled argument is passed as true, the Gamepad can move the GUI navigator. If the argument is false, the Gamepad can not move the GUI navigator.
If you want to check if a specified Gamepad is a set to be a navigation gamepad, you can use the UserInputService/IsNavigationGamepad
function. You can also use the UserInputService/GetNavigationGamepads
to retrieve a list of all navigation gamepads.
Since UserInputService
is client-side only, this function can only be used in a LocalScript
.
See this page for articles on cross-platform development.
See also
UserInputService/GamepadConnected
UserInputService/GamepadDisconnected
UserInputService/GetConnectedGamepads
UserInputService/GetNavigationGamepads
UserInputService/IsNavigationGamepad
UserInputService/IsGamepadButtonDown
UserInputService/GetSupportedGamepadKeyCodes
UserInputService/GetGamepadState
UserInputService/GetGamepadConnected
UserInputService/GamepadSupports
UserInputService/GamepadEnabled
Parameters
Name | Type | Default | Description |
---|---|---|---|
|
The |
||
|
Whether the specified gamepad can move the GUI navigator |
Returns
Return Type | Summary |
---|---|
No return |
Code Samples
UserInputService:SetNavigationGamepad
This example sets Enum/UserInputType|Gamepad1
as a navigation gamepad by passing Enum.UserInputType.Gamepad1 and true as arguments.
local UserInputService = game:GetService("UserInputService") UserInputService:SetNavigationGamepad(EnumUserInputType.Gamepad1, true)