RAIDER_GameJam/components/hit_box.gd
Felix Kaiser 3f62e5e31d blergh
2025-02-17 16:46:19 +01:00

16 lines
405 B
GDScript

extends Area3D
@export var health_component : HealthComponent
func _on_body_entered(body: Node3D) -> void:
if body is Projectile:
if is_instance_valid(health_component):
health_component.damage(body.damage)
body.projectile_collision()
func _on_area_entered(area: Area3D) -> void:
if area is ExplosionHurtbox:
if is_instance_valid(health_component):
health_component.damage(area.damage)