Multiple Area2Ds collide with different things

Godot 4.7

I’m very new to godot, sorry forgive me if this is a stupid question. In the game I’m making, the character has a hurtbox and a collection radius (ideally, it’s not working right now). I only want the hurtbox to interact with enemies, and I only want the collection radius to interact with items. My issue is I don’t know how to do that. I really don’t trust ai overview so I’m asking here.

You want to use collision layers.

For example, you could have one layer for ennemies, and one for items. Body and area nodes have a collision layer parameter where you can set one or multiple layers. So for your ennemies nodes, you would only set the enemy layer, and for items, the item layer.

Then for your hurtbox and collection radius (I suppose that they are area nodes) you will set the collision layer mask. the mask tells its area which layer it should detect. For example, you hurtbox area will have the enemy layer set in its mask. So, its area_entered signal will only react if an enemy is detected, but not an item.

Thank you, I’ll try it out