If you’re like me and struggle to use the OptionButton/PopupMenu Nodes with a controller.
I would suggest using an addon that provides the features of an OptionButton with controller support but in a horizontal manner.
Spin Button by yudinikita
Disclaimer: I did not create this add-on but found it after some research.
The Spin Button has a similar implementation to an OptionButton, but its navigation is managed through the next and previous controls. When you add SBSpinButton to your project, you can simply drag and drop it into the scene. The creator, yudinikita, has done an excellent job documenting how to use the additional features of the SBSpinButton to make it appear more user-friendly. (See the image below)
Issues I faced with Godot’s OptionButton implementation:
- The OptionButton itself does not register the
ui_accept
action to show the PopupMenu when using a controller. It will work fine for the keyboard and mouse just not the controller. - Calling
OptionButton.show_popup()
also does not make the MenuPopup appear. - Calling
OptionButton.get_popup().popup()
will show the MenuPopup and does not appear on the screen where you would expect it to or grab focus so that you can navigate the Popup using a controller.