Armazon/props/shelves/shelf.gd
2024-04-03 19:24:04 -04:00

14 lines
392 B
GDScript

extends RigidBody3D
func detonate():
var blast: Explosion = preload("res://props/explosion/explosion.tscn").instantiate()
get_parent().add_child(blast)
blast.global_transform = global_transform
queue_free()
func _on_body_entered(body: Node) -> void:
if body.name == "conveyor":
$Timer.start()
call_deferred("set_contact_monitor", false)
body_entered.disconnect(_on_body_entered)