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: