This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

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

the project :

in Engine by (71 points)

1 Answer

0 votes

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: 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.

by (1,663 points)

thanks doud thank you

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.