I have a character that has both “Walk” and “Run” animations. The walk animation has a cycle time of 1 second, while the run animation has a cycle time of 0.5 seconds. In addition, the engine allows for variable speed movement, such that when the character is moving at a rate of 0…3 meters per second, it uses the walk animation, but if the speed increases beyond 3 meters per second it shifts to the run animation.
The problem I’m having is avoiding the “stutter” when shifting between animations. I’ve tried various combinations of cross fading and setting the action time:
const proportionalTime = this.currentAnimation.time / oldClip.duration; action.time = proportionalTime * newClip.duration;
However, I can’t seem to get rid of the unsightly jerking when shifting modes.