How to prevent errors from popping up in debugger when scene functions normally?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LikeTheRogue

I set up some custom code to connect nodes via groups rather than signals. The following sample is what I put into the root node of my main scene:

func _ready():
	var player = get_node("Jo")
	var interactables = get_tree().get_nodes_in_group("Interactables")
	for i in range(interactables.size()):
		var currNode = get_node(interactables[i].get_path())
		var areaNode = currNode.get_node("Area")
		var args = Array([currNode])
		areaNode.connect("body_entered", player, "_on_Area_body_entered", args)
		areaNode.connect("body_exited", player, "_on_Area_body_exited", args)

When the Player collides with a target node’s Area it functions as intended. However, I end up with the following errors in the debugger. How do I stop these from occurring?


does player (a node named as “Jo”) have _on_Area_body_entered function?

volzhs | 2018-06-28 07:50

:bust_in_silhouette: Reply From: Zylann

You are getting this error because you connected body_exited to your player node with the _on_Area_body_exited function name. However, you didn’t define such function in your player node (Godot didnt find it). Maybe you forgot, or maybe you mistyped it.

If you are sure your scene works, then just don’t connect body_exited.