police car weak point

This commit is contained in:
Michael Campbell 2026-02-18 16:46:00 -05:00
parent 324e7d437b
commit 8a173b968d
15 changed files with 203 additions and 9 deletions

View file

@ -10,12 +10,14 @@ var health: int = 1:
if v == 0:
queue_free()
func _on_collision(node: Node3D):
if node.has_method("hit"):
if node.hit(self):
health -= 1
func _ready() -> void:
body_entered.connect(func(body: Node3D):
if body.has_method("hit"):
body.hit(self)
health -= 1
)
body_entered.connect(_on_collision)
area_entered.connect(_on_collision)
func init(dir: Vector3) -> void:
_initialized = true