PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

SelectedObject

GuiService

GuiObject

Sets the GuiObject currently being focused on by the GUI Navigator (used for Gamepads). This may reset to nil if the object is off-screen.

This property is changed by the GuiObject/SelectionGained and GuiObject/SelectionLost events.

If you would like to determine when this property changes without tracking the SelectionGained and SelectionLost events for all GUI elements, you can use the Instance/Changed|Changed event.


Code Samples


Printing When Gamepad Selection Changes

The code below demonstrates how to handle when the SelectedObject changes. For instance, this event fires when the Gamepad navigates to another GUI element.