how to kill enemies whith out signals

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

i have a game project and i use signals to kill enemies using a area2d and a costom signal and i wonder if ther is another way . or any easyer way to do so . thats going to save a lot of time for me .

hir is my project :

the level 1 is in the botom of res its name is scene1

thats going to save a lot of time for me.

Are you connecting the signal in the editor’s node tab or script?

Magso | 2019-09-30 20:29

i connecting the in the editors node

abdolilah | 2019-09-30 21:13

Script is usually easier when you need a lot of nodes to send signals to a parent script. You could also create a separate scene for the enemy and connect the signal there. If you put the enemies in a group like hhuseyincihangir said, you’ll have to connect the signal to whatevers killing the enemy, then have it tell the enemy to kill itself.

Magso | 2019-09-30 21:46

:bust_in_silhouette: Reply From: hhuseyincihangir

Instead of using a signal each time, you can use groups. You add them to the same group.

You can see your example in the video.

Signals and Groups Video

thanks a lot

abdolilah | 2019-09-30 21:20