Skip to content

Commit

Permalink
Fix condition always true in navigation demo
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanLovato committed Jun 19, 2018
1 parent 4f40b09 commit b355e39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 2d/navigation/navigation.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b355e39

Please sign in to comment.