mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
Character Engine: Loop once during transition so the clamp actually works
This commit is contained in:
1 parent
727598c2bc
commit
48123821ed
1 file changed
+2
-1
@@ -105,6 +105,7 @@ export class CharacterAnimationEngine {
|
||||
nextAction.setEffectiveWeight(progress);
|
||||
|
||||
// Make sure we hold that last frame for the previous action
|
||||
prevAction.loop = THREE.LoopOnce;
|
||||
prevAction.clampWhenFinished = true;
|
||||
|
||||
// The next action should stay at the first frame
|
||||
@@ -132,7 +133,6 @@ export class CharacterAnimationEngine {
|
||||
|
||||
// If timestamp not in any clip, do nothing.
|
||||
// If timestamp in clip, set mixer to the timestamp inside the clip
|
||||
console.log(currentClip)
|
||||
if (!currentClip) {
|
||||
console.log("INTERPOLATING CLIPS")
|
||||
// Let the interpolation function handle this actions
|
||||
@@ -154,6 +154,7 @@ export class CharacterAnimationEngine {
|
||||
// Since it's the only clip in this timestamp, make it full weight and make sure it's not paused (from interpolation or otherwise)
|
||||
animationAction.setEffectiveWeight(1);
|
||||
animationAction.paused = false;
|
||||
animationAction.loop = THREE.LoopRepeat;
|
||||
|
||||
// Necessary to ensure the actions are active - the default is inactive, mixer won't do anything
|
||||
animationAction.play();
|
||||
|
||||
Reference in new issue
Block a user