Skip to content

Commit eae6c07

Browse files
committed
Fix animation reverse
1 parent efd9fd5 commit eae6c07

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/hand-controls.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,13 @@ module.exports.Component = registerComponent('hand-controls', {
339339
toAction.loop = THREE.LoopRepeat;
340340
toAction.repetitions = 0;
341341
toAction.timeScale = reverse ? -1 : 1;
342+
toAction.time = reverse ? clip.duration : 0;
342343
toAction.weight = 1;
343344

344345
// No gesture to gesture or gesture to no gesture.
345346
if (!lastGesture || gesture === lastGesture) {
347+
// Stop all current animations.
348+
mesh.mixer.stopAllAction();
346349
// Play animation.
347350
toAction.play();
348351
return;

0 commit comments

Comments
 (0)