Attention | Topic was automatically imported from the old Question2Answer platform. | |
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?
Thanks!
does player (a node named as “Jo”) have _on_Area_body_entered
function?
volzhs | 2018-06-28 07:50