From 6d30d123d61f9afb81922f354897cd555777d7cb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 20 Apr 2024 02:23:45 +0200 Subject: [PATCH] Allow `find_closest_target` to find `Draggable`s of any name --- scenes/game/cursor.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenes/game/cursor.gd b/scenes/game/cursor.gd index 23f78e2..ccf8426 100644 --- a/scenes/game/cursor.gd +++ b/scenes/game/cursor.gd @@ -23,7 +23,7 @@ func find_closest_target() -> Draggable: var min_distance: float = INF var to_drag: Node = null for body in bodies: - for target in body.find_children("Draggable", "Draggable", false, false): + for target in body.find_children("*", "Draggable", true, false): var distance = position.distance_to(target.position) if distance < min_distance: min_distance = distance