Problem with Area2D and layer/mask

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

So, I have 4 layers: World → Player → PlayerHurtBox → EnemyHurtBox.
I have a scene of grass, that player can damage. It has a Sprite and HurtBox (Area2D) where the layer is EnemyHurtBox. Only one player’s hitbox has mask EnemyHurtBox but my problem is that two or more pieces of grass scene destroy each other when one cover another. For this problem I did layers but it didn’t help.

Collisions cover each other
only layer EnemyHurtBox

den1s | 2020-12-05 19:12

It has a signal “area_entered()” that does “queue_free()”

den1s | 2020-12-05 19:21

Ask me some images for more information if you need

den1s | 2020-12-05 20:29

:bust_in_silhouette: Reply From: den1s

It must work without it…
but the possible solution is to add a group in Grass.tscn, for example, “grass” and write the code:
if area.get_parent().is_in_group("grass"): return