Score system doesnt work

Godot Version

godot 4

Question

I was trying to create this simple score system, but it decided to not work, even copying from tutorials.


I was using a signal from the enemy (yoginho)
Captura de tela 2024-12-21 223126
And this game_manager was supposed to show the score on label.

How did you connect the signal from the enemy to to game_manager and are there more then one enemy?

The signal is connected through the inspector tab in nodes. The enemies are generated by a spawner, that instantiate them, probrably this is what’s wrong, but I dont know how to fix it.

when you instantiate new enemies you have to connect the signal for every instance:

enemy = enemy_packed.instantiate()
enemy.add_score.connect(game_manager._on_yoginho_add_score)
2 Likes

Thanks man, I was a bit stressed yesterday, thats why I didn’t give enough information.

2 Likes