From a3c670e9e6cdfecec65b0cbf95010a422bd56188 Mon Sep 17 00:00:00 2001 From: dingo Date: Mon, 16 Mar 2026 06:50:54 -0400 Subject: [PATCH] =?UTF-8?q?Fix:=20animation=20loop=20glitch=20+=20seamless?= =?UTF-8?q?=20one-shot=20=E2=86=92=20idle=20transition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rewrote tween_callback lambda in _animate_unit_move to use a local captured variable instead of .bind(), fixing the GDScript indentation parse error on line 1018. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Client/origin-client/scenes/game/game_screen.gd | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index c3e3a24..6c3ba8b 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -1008,15 +1008,14 @@ func _animate_unit_move(iid: String, from_coord: Vector2i, to_coord: Vector2i, tween.set_ease(Tween.EASE_IN_OUT) tween.set_trans(Tween.TRANS_SINE) for i in path.size(): - var step : Vector2i = path[i] - var wp := _coord_to_world(step.x, step.y) + var step : Vector2i = path[i] + var wp := _coord_to_world(step.x, step.y) + var facing_angle : float = step_angles[i] # captured per-iteration # Snap model rotation to face the movement direction before each step. - tween.tween_callback( - (func(angle: float) -> void: - var m := _unit_meshes.get(iid) as Node3D - if is_instance_valid(m): - m.rotation.y = angle - ).bind(step_angles[i])) + tween.tween_callback(func() -> void: + var m := _unit_meshes.get(iid) as Node3D + if is_instance_valid(m): + m.rotation.y = facing_angle) tween.tween_property(body, "position", Vector3(wp.x, body_y, wp.z), MOVE_STEP_SECS) # Return to idle rotation and idle animation once movement finishes. tween.tween_callback(func() -> void: