I have this code to check for collision for bullet and remove the bullet:
func _on_area_2d_area_shape_entered(area_rid, area, area_shape_index, local_shape_index):
var parent = area.get_parent()
if parent.is_in_group("shot"):
parent.queue_free()
print("took damage")
health -= parent.damage
It works 70% of the time but rest of the time it will damage the enemy 2 times. This could be considered a "feature" with critical hits but for my game it is important that there are no "critical hits" 😄
my bullet node: