|Topic was automatically imported from the old Question2Answer platform.
Hello! I’m working on a platformer battle game where I have a player, weapon, and enemy. I want to have:
- The Enemy hurt by the Weapon, not the player
- The Player hurt by the Enemy, not the weapon
- The weapon doesn’t have health so that’s not a problem.
I noticed in the Inspector tab for an Area2D that there is a collision layers and mask area. I read the description and it seems like I could just mask the player in a enemy layer and mask the enemy on a weapon layer but it doesn’t seem to work - The player and the enemy are getting hurt simultaneously no matter what I do. Should I do something else (it’s not possible to make what I want, work with collision layers and masks), or is there an easy solution using collision layers and masks that I’m missing.