Fix: attack animation collapsed the model into the floor (partial Root clip + WDV)

The procedural attack clips key only the Root bone, but the Attack/MeleeSwing states had writeDefaultValues=true -> a partial (Root-only) clip resets every un-keyed bone (Hips/Spine/legs) to Rukhanka defaults (~identity), collapsing the body into the floor (player + enemy). Root carries the mesh-positioning offset (localPos -0.90, identity rot) while Hips/Spine carry the authored orientation. Fix: writeDefaultValues=false on the attack states (leave un-keyed bones in pose, only lean the Root). Patched both controllers + both recipes (PlayerRigTools/EnemyRigTools) so a rebuild can't regress. Rule: partial bone-subset overlay clips => writeDefaultValues=false.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 23:42:44 -07:00
parent 7b3c9cc2a5
commit 1b07a6b07f
4 changed files with 4 additions and 4 deletions
@@ -42,7 +42,7 @@ AnimatorState:
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_WriteDefaultValues: 0
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
@@ -283,7 +283,7 @@ AnimatorState:
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_WriteDefaultValues: 0
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
@@ -146,7 +146,7 @@ namespace ProjectM.EditorTools
var attackClipAsset = AssetDatabase.LoadAssetAtPath<AnimationClip>(AttackClip);
var attack = sm.AddState("Attack");
attack.motion = attackClipAsset;
attack.writeDefaultValues = true;
attack.writeDefaultValues = false; // partial (Root-only) clip: MUST be false, else WDV resets every un-keyed bone (Hips/Spine/legs) to identity and the body collapses into the floor
var toAttack = sm.AddAnyStateTransition(attack);
toAttack.hasExitTime = false;
@@ -50,7 +50,7 @@ namespace ProjectM.EditorTools
if (swing == null)
{
swing = sm.AddState("MeleeSwing");
swing.writeDefaultValues = true;
swing.writeDefaultValues = false; // partial (Root-only) clip: MUST be false, else WDV resets every un-keyed bone (Hips/Spine/legs) to identity and the body collapses into the floor
var toSwing = sm.AddAnyStateTransition(swing);
toSwing.hasExitTime = false;