7 lines
175 B
GDScript3
Raw Normal View History

2024-02-13 09:38:26 +00:00
extends Area3D
func on_body_entered(body: Node3D):
var health := body.get_node_or_null("Health") as HealthComponent
if health:
2024-02-13 12:49:28 +00:00
health.take_damage(DamageInstance.new(50))