Did I set up the signal wrong?

//player scene
func get_input():
if Input.is_action_just_pressed(“self”) and can_shoot:
print(“hello”)
self_Shot.emit(global_position)
can_shoot = false
await get_tree().create_timer(0.6).timeout
can_shoot = true
//level scene
func _on_player_self_Shoot(pos: Vector2) → void:
print(“hello 2”)
if mag_Postion > max_Ammo:#“Reloading” the cylendier
print(“reset”)
mag_Postion = 0
#creating a variable the player scene can understand
var bullet_Type = chamber_Count[mag_Postion]
#tell the player scene what bullet it is
player_Shot.emit(bullet_Type)
mag_Postion = mag_Postion + 1

Question

to me the signal is set up right but it looks like func _on_player_self_Shoot never runs

Make sure to format your code pastes properly

Seems like you are anticipating the connection through the editor, can you share a screenshot of your scene tree? Does your code have the green connected symbol by your connected function?

1 Like