It gives me these errors:
1- Invalid argument for "connect()" function: argument 2 should be "Callable" but is "HurtBox".
2- Invalid argument for "connect()" function: argument 3 should be "int" but is "String".
code:
class_name HurtBox
extends Area2D
func _init() -> void:
monitorable = false
collision_mask = 2
func _ready() -> void:
connect("area_entered", self, "_on_area_entered")
pass
func _on_area_entered(hitbox: HitBox) -> void:
print("done")
if owner.has_method("take_damage"):
owner.take_damage(hitbox.damage)