Skip to content

Commit

Permalink
fix: transition animations
Browse files Browse the repository at this point in the history
  • Loading branch information
punktkomma committed Jan 30, 2024
1 parent ac76ac7 commit eb80a69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ function init() {
scene.add(skeleton);

const animations = gltf.animations;
console.log(animations);
mixer = new AnimationMixer(model);

idleAction = mixer.clipAction(animations[0]);
Expand Down Expand Up @@ -470,14 +471,14 @@ function updateCrossFadeControls() {
crossFadeControls[0].enable();
crossFadeControls[1].disable();
crossFadeControls[2].enable();
crossFadeControls[3].enable();
crossFadeControls[3].disable();
}

if (idleWeight === 0 && walkWeight === 0 && runWeight === 1) {
crossFadeControls[0].disable();
crossFadeControls[1].enable();
crossFadeControls[1].disable();
crossFadeControls[2].disable();
crossFadeControls[3].disable();
crossFadeControls[3].enable();
}
}

Expand Down

0 comments on commit eb80a69

Please sign in to comment.