Setting GuiService.SelectedObject to invalid GuiObject on TextButton

image

if UserInputService.GamepadEnabled then
	print("SET")
	GuiService.SelectedObject = logoScreen.Buttons.Play
	print("SETTED")
end

Play is a TextButton, so I don’t see why any reason it can’t be set? Unsure of any other way to select a button for gamepad. Also tried AutoSelectGuiEnabled but that does nothing

2 Likes

I know this is an old post, but I’ve just had this problem myself and this was one of the first results…

So for anyone having this issue in the future.

This warning will occur if…

  • The element has selectable disabled
  • The element is offscreen
  • The element (or it’s parent) is not visible

It’s also worth checking that the warning is coming from where you think it’s coming.
For example if you are using events such as LastInputTypeChanged in different scripts, you could be trying to set the SelectedObject to two different values at the same time.

4 Likes

thanks this helped me not waste 6 hours of my life trying to figure it out

1 Like