This event fires when the Gamepad selector starts focusing on the
If you want to check from the Gamepad select stops focusing on the GUI element, you can use the
When a GUI gains selection focus, the value of the
GuiService/SelectionObject|SelectionObject property also changes to the that gains selection. To determine which GUI gained selection, check the value of this property.
Handling GUI Selection Gained
The following example prints a message when the user selects the object with a gamepad.
In order for this to work as expected, it must be placed in a
LocalScript and a child of gui.
local gui = script.Parent local function selectionGained() print("The user has selected this button with a gamepad.") end GuiObject.SelectionGained:Connect(selectionGained)