extends RigidBody2D @onready var timer = $Timer var enter_count = 0 # Called when the node enters the scene tree for the first time. func _ready(): timer.start() # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): pass func _on_timer_timeout(): queue_free() func _on_area_2d_body_entered(body): enter_count += 1 if enter_count > 2: queue_free() func _on_enemie_die_body_entered(body): body.f_die() queue_free()