Godot Version
4.4
Question
Hi! I’ve issuing with a small problem, it seems that if you try to connect the signals of a child to its parent functions it doesn’t work. This is the current hierarchy:
If I try to connect via the Editor or by code and the functions are in Enemy, it doesn’t work, but if the functions are in Area3D it does, I’m missing something?
# Enemy.gd
extends Node3D
func _ready():
$Area3D.connect('body_entered', _on_body_entered)
$Area3D.connect('body_exited', _on_body_exited)
func _on_body_entered(body: Node3D) -> void:
print("HI HI: " + body.name)
func _on_body_exited(body: Node3D) -> void:
print("BYE BYE: " + body.name)
# Area3D.gd
extends Area3D
func _ready():
$".".connect('body_entered', _on_body_entered)
$".".connect('body_exited', _on_body_exited)
func _on_body_entered(body: Node3D) -> void:
print("HI HI: " + body.name)
func _on_body_exited(body: Node3D) -> void:
print("BYE BYE: " + body.name)