From 200b40db803e2426b58cb33b39877e285c1ffc50 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 3 May 2024 02:45:17 +0200 Subject: [PATCH] Prevent softlock at start of game --- entities/gold.gd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/entities/gold.gd b/entities/gold.gd index edc5fa9..85a9613 100644 --- a/entities/gold.gd +++ b/entities/gold.gd @@ -29,3 +29,8 @@ func _on_move(movement: Vector2) -> void: func _physics_process(delta: float) -> void: if move_towards.target != null: move_towards.speed *= pow(speed_up_factor, delta) + + +func _on_delete_if_not_on_screen_screen_exited() -> void: + if move_towards.target == null: + queue_free()