Files
Godot-Modules/DamageHandling/hurt_box.gd
T

19 lines
497 B
GDScript

class_name HurtBox extends Area2D
signal damage_recieved(damage:float)
@export_flags("player","enemy") var respond_from
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func on_damage_receieved(hitbox:HitBox):
if hitbox.damage_type & respond_from:
damage_recieved.emit(hitbox.damage)
#if type