I made a projectile (ki blast) and added it into a group(enemy_killer). Now when the projectile hits the enemy, he doesnt die. I tested that if the area entered the enemy, print(area entered), but it doesnt work. Script:-
extends AnimatedSprite2D
func _on_hitbox_area_entered(area):
print(“in area”)
if area.is_in_group(“enemy_killer”):
print(“in group”)
area.get_parent().queue_free()
queue_free()
Have you checked your collision layers. Here is an example from one of mine:
Here you can see the player is in Layer 1 (which is named ‘Player’). All the mask layers are layers that it detects. If something is in layer 4, say, my player will not detect it.
It is also worth checking that your areas are either monitorable, monitoring or both. These are checkboxes in the inspector.
It might also be more useful to print the area itself like this:
print("Hitbox area entered: ", area)
You seem to imply that this was working before you added the group. So it is also worth double checking that your group name is the same as the one you are testing for: ‘enemy_killer’.