Force something to be selected? (Gamepad UI)


#1

So I’m trying to make my UI compatible with game controllers. I’ve managed to make it work pretty well so far, but there’s one thing that’s extremely annoying. Even if I set the Selected property to true on an element, it isn’t selected for my gamepad.

I have many “popup” windows that show up that are easy enough to close on PC, but since for some reason my close buttons don’t get selected by default when a controller is plugin, one has to manually go through all my elements and select it. Shivers.

I already bound some UI to buttons so that is not going to help. I don’t want every single button opening a different UI object anyway.

Is there something I’m doing wrong? Why aren’t my buttons selected by default like I thought they would be?


#2

You might find these APIs useful:

https://developer.roblox.com/api-reference/property/GuiService/SelectedObject
https://developer.roblox.com/api-reference/function/GuiService/AddSelectionParent
https://developer.roblox.com/api-reference/function/GuiService/AddSelectionTuple


#3

That first one seems legit.