mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-21 23:54:23 +00:00
Allow find_closest_target
to find Draggable
s of any name
This commit is contained in:
parent
b222f9a7ff
commit
6d30d123d6
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ func find_closest_target() -> Draggable:
|
||||||
var min_distance: float = INF
|
var min_distance: float = INF
|
||||||
var to_drag: Node = null
|
var to_drag: Node = null
|
||||||
for body in bodies:
|
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)
|
var distance = position.distance_to(target.position)
|
||||||
if distance < min_distance:
|
if distance < min_distance:
|
||||||
min_distance = distance
|
min_distance = distance
|
||||||
|
|
Loading…
Reference in a new issue