![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | FerozAkbar |
hi guys,
i have 3 scenes
main.tscn player.tscn enemy.tscn(this have areadbody)
in enemy.gd script
signal exited
func _on_enemy_body_exited(body):
emit_signal("exited")
in player.gd script
func test():
print("XYZ")
but the connect function is not written in player script because both the enemy and player are dynamically instanced in the main node
in main.gd script
onready var player_scene = preload("res://player.tscn")
onready var enemy_scene = preload("res://enemy.tscn")
enemy_scene.connect("exited", player_scene, "test")
but its not working, how to connect the signal of enemy to player