That is not the correct logic for collision detection.
Layer: This represents which layer the current node is.
Mask: This represents the layers that object scans for collision.
So if they are both in the same layer. But then you change the mask to a different layer, the nodes cannnot detect the collision. For your detection to work, the ‘Mask’ set on the Area2D node should include the ‘Layer’ set for the Charcaterbody2d
the function works when i put it in characterbody2d but i need it in area2d…(just to be clear the function doesnt work in characterbody2d when i enter area2d in game it just instantly works because the characterbody2d is inside itself so it counts it as body entered)
Seems like the signal isn’t connected correctly? You have to make sure to connect it from the Area2D to itself (if that’s where you want to call a function).