GrappleTest/Objects/DeathCollider/DeathCollider.gd
2024-03-13 16:15:55 -05:00

13 lines
276 B
GDScript

extends Area2D
var killing = null
@export var detecting := false
func _on_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
if "die" in body and detecting:
killing = body
func _physics_process(delta):
if killing:
killing.die()
killing = null