7 lines
175 B
GDScript3
7 lines
175 B
GDScript3
|
extends Area3D
|
||
|
|
||
|
func on_body_entered(body: Node3D):
|
||
|
var health := body.get_node_or_null("Health") as HealthComponent
|
||
|
|
||
|
if health:
|
||
|
health.take_damage(DamageInstance.new(10))
|