Help getting Spinboxes to work with controller

Godot 4.3

Whenever I navigate to a spinbox, the focus enters the textbox and there’s no way to navigate to anything else in my settings menu. Is there a way to make it focus on the arrow buttons instead? If not, are there any workarounds besides building something like a spinbox from scratch?

In the inspector, under Focus, select the nodes you want to go to if you move right or left, and then you won’t get stuck.

Then just add a script to the spinbox. Something like:

func _input(event):
	if event.is_action("ui_up"):
		value += step
	elif event.is_action("ui_down"):
		value -= step
1 Like

This works well! Is there a way to make it slower? It is quite fast at spinning up numbers, any way to play with the sensitive-ness of it?

Yes. Change the Step value.

I meant outside the step value, I need the step to be big increments of exactly 100 so that’s not really an option, I meant the speed that the step gets updated while holding down arrow keys?

event.is_action will trigger for pressed and released actions, and potentially echo actions. If you are using a controller this may also trigger for every angle tilted up past the deadzone.

This snippet should be more controlled and potentially significantly slower

var stepable: bool = true

func _input(event):
	if stepable and event.is_action_pressed("ui_up"):
		value += step
		stepable = false
	elif stepable and event.is_action_pressed("ui_down"):
		value -= step
		stepable = false
	elif event.is_action_released("ui_up") or event.is_action_released("ui_down"):
		stepable = true

This works! It no longer gets triggered a bunch of times while holding down arrow keys so that helps. Cheers!