enemy killing issue

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By abdolilah

now if i attack an enemy 30 times he die then if attack another enemy hi dies after the first attack

the project :


:bust_in_silhouette: Reply From: Eric Ellingson

It seems the problem is that you did not connect the signals to the enemy2 instance. This meant that every time you hit an enemy (didn’t matter which one), it always damaged the enemy node and never the enemy2 node.

For the hit signal from the player, you needed to connect for enemy2:
enter image description here

Same for the attack_entered signal:
enter image description here

And the enter_entered:
enter image description here

Here is a zip of the working project: platformer 2 2.zip - Google Drive Note that I changed the damage done from 1 to 100 so that you don’t have to hit it so many times in order to test.

thanks doud thank you

abdolilah | 2019-07-29 13:52