Area 2d on_body_enter does not trigger although the collision layers are correct and signal is connected

Godot Version

4.4.1

I have a player in the 2d scene and it has
Collision Layer: 2
Mask: 1

and a coin:
Collision Layer: 1
Mask: 2

And the coin has a script which the on_body_entered signal Is highlighted as it is connected



I am expecting it to print “coin” but it does not. What else do I need to setup for a collision?

Use area_entered not on_body_entered.

on_body_entered is for when you are colliding with physics body such as RigidBody.

area_entered is for when you are colliding with other Area2ds which appears to be the case here.