fix: clear global pose overrides when switching to procedural anim

This commit is contained in:
2026-06-25 11:34:30 -04:00
parent e4ea177eaf
commit 000caa7791
+2
View File
@@ -515,7 +515,9 @@ func _process(delta: float) -> void:
animation_player.active = false animation_player.active = false
# Reset all bones to rest pose before applying procedural animation # Reset all bones to rest pose before applying procedural animation
if skeleton: if skeleton:
# Clear any previous global pose overrides
for i in range(skeleton.get_bone_count()): for i in range(skeleton.get_bone_count()):
skeleton.set_bone_global_pose_override(i, Transform3D(), 0.0, true)
skeleton.set_bone_pose_rotation(i, _bone_rest_local_rot.get(i, Quaternion.IDENTITY)) skeleton.set_bone_pose_rotation(i, _bone_rest_local_rot.get(i, Quaternion.IDENTITY))
skeleton.set_bone_pose_position(i, _bone_rest_local_pos.get(i, Vector3.ZERO)) skeleton.set_bone_pose_position(i, _bone_rest_local_pos.get(i, Vector3.ZERO))
elif animation_player and animation_player.has_animation(target_anim): elif animation_player and animation_player.has_animation(target_anim):