Now, here's the awaited long answer. My main player wants to use the sword in her hands to smash many things into her world. First, she wants to smash ennemies. And crates. And rocks. And occasinally plants, maybe because she's pollen-allergic although it's probably not a very good idea).
In order to make the sword aware of the object it crosses, I had first to create an Area2D around the sword like that
However wa have to discriminate when the Area2D crosses something to smash and when it crosses something else. In order to do that, we just kept the relevant area entering discarding all the bodies (RigidBody2D) and Area2D which doesn't belong to a given group, a group we tag as 'destroyable'.
In order to set a given node to a group, you just have to select the group button at the top of the Tree View (the selected button in the next screenshot)
So all our smashable objects are in the same group, the "destroyable" group. Then,in the code of the Area2D we just call a damage() function on any object of the destroyable group. Therefore the ennemies, the crates, the plants should have a damage() function which can all be different, allowing to have different behavior when those entities are destroyed. The gdscript for the sword is the following
Note that we first check that the girl is playing the "hit" animation, which assures that the girl is effectively doing a hit gesture.
And that's it !