14 lines
392 B
GDScript3
14 lines
392 B
GDScript3
|
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)
|