Signal Debugger Issues

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:

What happens if you change this line to:

drone2.enemy_shot.connect(_on_enemy_shot.bind())

?

looks like i start getting this error
image

Does your enemy class have a class_name?

e: My guess is it doesn’t. What that error message says is that your enemy is of type Marker3D, and that class doesn’t have custom signals. If you add a class_name to your script, the signal should become visible. (Provided you instantiate the enemy by that class name instead of as a Marker3D.)

1 Like

Oh my gosh I’m dumb had the enemy group toggled on my timer and marker3d so it was trying to connect those 2 to the signal as well. Thank you so much for the help i really appreciate it. <3