Godot Version
Godot v4.4.1 stable
Question
I’m having an issue where the debugger is saying I have an invalid signal connection, yet the signal is behaving as expected. The signal is called enemy_shot and it serves to allow the level to instantiate the bullets within the level. I included everything I think is relevant but please let me know if more is needed.
Level Script:
@onready var enemy_bullet:PackedScene = preload("res://Scenes/Enemy/enemy_bullet.tscn")
func _ready() -> void:
for drone2 in get_tree().get_nodes_in_group("Drone_2"):
drone2.connect("enemy_shot", _on_enemy_shot)
func _on_enemy_shot(pos,dir) -> void:
var bul:Enemy_Bullet = enemy_bullet.instantiate()
add_child(bul)
bul.set_dir(pos,dir)
Enemy Scipt:
signal enemy_shot
func shoot():
var direction
can_shoot = false
$Attack_Timer.start()
direction = ($Attack_Spawn/BulletPath.to_global($Attack_Spawn/BulletPath.target_position)-$Attack_Spawn/BulletPath.to_global(Vector3.ZERO)).normalized()
enemy_shot.emit($Attack_Spawn.global_position,direction)
Debugger: