A menu navigable with a controller

Godot Version

4.2.2

Question

To make my menu, I have watched a youtube tutorial.
I can use it with a mouse but I want to make it usable with a controller.
The code of the menu:

extends Control

	
func _on_play__pressed():
	get_tree().change_scene_to_file("res://Scenes/LVL-Test.tscn")
	
func _on_quit_pressed():
	get_tree().quit()

func _on_options_pressed():
	get_tree().change_scene_to_file("res://Scenes/GUI/options.tscn")

I have three buttons : Play, Options and Quit.
How can I do ?

Hi, menus are navigable with controller by default. the ui actions in the input map (press show built in actions to show them) have controller bindings by default. all you need to do is to call the grab_focus function on one of the buttons on ready or when you want the player to be able to interact with the menu

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.