From b355e3937a94fb28441469bec57f821d7cbdae3c Mon Sep 17 00:00:00 2001 From: Nathan Lovato Date: Tue, 19 Jun 2018 10:42:30 +0900 Subject: [PATCH] Fix condition always true in navigation demo --- 2d/navigation/navigation.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2d/navigation/navigation.gd b/2d/navigation/navigation.gd index 691d8f3a..8c719fba 100644 --- a/2d/navigation/navigation.gd +++ b/2d/navigation/navigation.gd @@ -32,7 +32,7 @@ func move_along_path(distance): for index in range(path.size()): var distance_between_points = last_point.distance_to(path[0]) # the position to move to falls between two points - if distance <= distance_between_points: + if distance <= distance_between_points and distance >= 0.0: $Character.position = last_point.linear_interpolate(path[0], distance / distance_between_points) break # the character reached the end of the path