diff --git a/entities/player/scripts/player.gd b/entities/player/scripts/player.gd index 916a0f2..d265772 100644 --- a/entities/player/scripts/player.gd +++ b/entities/player/scripts/player.gd @@ -26,7 +26,8 @@ func try_interact(): if len(interactables) > 1: # Sort them to the closer interactables.sort_custom( - func (el : Interactable): return el.global_position.distance_to(global_position) + func (el1 : Interactable, el2 : Interactable): + return el1.global_position.distance_to(global_position) > el2.global_position.distance_to(global_position) ) interactables[0].interact(self)