I need help with signals from a player which gets preloaded from a scene

Godot Version



I got my own custom signal for a towerdefense game but it only arrives the first time i use it because i remove the character(which is a own scene) and then i preload him (like towerdefense spawning enemys)

Here is the enemys code:

extends PathFollow2D

var goblin_hp = 1
@export var goblin_speed = 40
signal goblin_died

Called when the node enters the scene tree for the first time.

func _ready():
pass # Replace with function body.

Called every frame. ‘delta’ is the elapsed time since the previous frame.

func _physics_process(delta):
var new_offset = get_progress() + goblin_speed * delta

if (loop == false and get_progress_ratio() == 1) or (loop == false and goblin_hp < 1):
if goblin_hp < 1:

func _on_area_2d_body_entered(body):
if body.name == “Arrow”:
goblin_hp = goblin_hp - 1

And here is the code to update my money label from the signal:

extends CharacterBody2D

@export var money = 10
var HP = 2

func _physics_process(delta):
if HP < 1:
print(“you loose”)

$Money.set("theme_override_colors/font_color", Color(1, 1, 0))
$Money.text = "Money = %d" % money

func _on_tower_collision_body_entered(body):
if body.name == “Goblin”:
HP = HP - 1

func _on_path_follow_2d_goblin_died():
money = money + 5