[Solved] How can I sum up damage from several enemies?

Hi guys! How can I sum up damage from collision with several enemies, if their damage is -1 per second, and the player is attacked by several enemies at the same time? I set condition for enemy is in collision with player, enemy stops and variable “player health” is -1, timer reset is for 1 second. But I get -1 hp in 1 sec even if there is a lot of enemies in collision with player… what I’m doing wrong? :slight_smile:

I solved this problem by adding a variable to the enemy, that changes when it collides with the player. And I added a variable to the scene that counts all the enemies in collision with the player whose variables have not changed yet. And the player’s health decreases from this last variable.

1 Like