le pathfinder emène exactement là où on a cliqué

This commit is contained in:
Thomas
2025-03-29 19:54:58 +01:00
parent 629c6b1b11
commit 01fb28cbdf
2 changed files with 3 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ func _process(delta: float) -> void:
controled.moveFeetTo(world.to_global(world.map_to_local(toFollow.front())));
else:
var distance_to_goal = abs(destination - my_global_position)
if distance_to_goal>Vector2(3, 3):
if distance_to_goal.x > 3 or distance_to_goal.y > 3:
controled.moveFeetTo(destination)
else:
destination = Vector2.INF