In reality, you actually have to connect emit_signal("hit") to body_shape_entered(body) function, which you will find after connecting that signal in the signals tab to the mob.
There is one tiny problem in doing that, however, and that is if the mobs collide with each other.
A work-around is to name the player, say Player, for instance, and add:
if body.name == "Player":
and then indent, and add emit_signal("hit")
.
Another thing is that, if the mobs collide with each other, they will not stop moving. Changing the mob from a rigidbody2D into an Area2D would be a quick fix, but you would then have to change the signals slightly. In that case, instead of body_shape_entered(body)
, you would use body_entered(body)
.