From ea840b45d1e5370b150e2532e69ed697f0ea9015 Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 10 May 2026 17:24:34 -0400 Subject: [PATCH] =?UTF-8?q?Fix=206:=20don't=20kill=20shader=20tweens=20on?= =?UTF-8?q?=20rebuild=20=E2=80=94=20fixes=20stuck=20materialize=20effect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix 3 killed all shader tweens at the top of every rebuild_units() call. This interrupted materialize/ascend-arrival tweens mid-animation for units that were staying on the board. Because tween.kill() skips the completion callback, the mi.material_override was never restored, leaving every model permanently frozen in the reveal=0..1 shader state with no actual mesh visible. Tweens run to completion naturally. The WeakRef + is_instance_valid guards inside each tween callback already handle pooled/freed nodes safely, so there is no leak when a unit is removed while its tween is still running. _exit_tree() still kills all tweens on scene teardown. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .../scenes/game/components/units/unit_mesh_builder.gd | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Client/origin-client/scenes/game/components/units/unit_mesh_builder.gd b/Client/origin-client/scenes/game/components/units/unit_mesh_builder.gd index 357effd..e8c21e6 100644 --- a/Client/origin-client/scenes/game/components/units/unit_mesh_builder.gd +++ b/Client/origin-client/scenes/game/components/units/unit_mesh_builder.gd @@ -101,14 +101,6 @@ func _acquire_from_pool(card_type: String) -> StaticBody3D: ## Recreating a unit body interrupts its running animation (idle/move/attack), ## causing a one-frame bind-pose flash on every state echo. func rebuild_units(state: Dictionary) -> void: - # Kill all in-flight shader tweens so ShaderMaterial refs are released now. - for t: Tween in _active_tweens: - if is_instance_valid(t): - t.kill() - _active_tweens.clear() - if OS.is_debug_build(): - print("UnitMeshBuilder: rebuild - killed %d shader tweens" % _active_tweens.size()) - # Kill any in-flight movement tweens. for iid: String in move_anims: var t: Tween = move_anims[iid] as Tween