Key binding error

4.4

i was following a tutorial on how to add Key binding to a game and when i test it error says break point at action_label.text = action, what does it mean? also how do i fix it?

extends Control



@onready var input_button_scene = preload("res://assests/InputSettings/input_button.tscn")
@onready var action_list = $"PanelContainer/MarginContainer/VBoxContainer/ScrollContainer/Action list"



var is_remapping = false
var action_to_remap = null
var remapping_button = null



func _ready():
	_create_action_list()
	

func _create_action_list():
	InputMap.load_from_project_settings()
	for item in action_list.get_children():
		item.queue_free()
	
	for action in InputMap.get_actions():
		var button = input_button_scene.instantiate()
		var action_label = button.find_child("LabelAction")
		var input_label = button.find_child("LabelInput")
		
		action_label.text = action
		
		var events = InputMap.action_get_events(action)
		if events.size() > 0:
			input_label.text = events[0].as_text()
		else:
			input_label.text = ""
		
		action_list.add_child(button)

Probably that means action_label is null, which in turn probably means that either button doesn’t have a direct child called "LabelAction” or button itself is also null.

You might want to check your strings for spelling and case matches.

1 Like

Thanks