My artist gave me a character with an animation of it vaulting over a wall and then rolling. The animation has the root bone moving up, then down, and then forward a few feet. I am at a loss for how to handle this.
What happens now is the character vaults over the wall, and then snaps back to its original position. I tried teleporting the character to the roots new position after the animation was done, but it creates a noticeable jump, and messes with the physics, sometimes teleporting him through walls or getting stuck in other characters.
I was thinking I could write a script that evaluates the root movement of an animation, and then moves the character through the physics engine the correct amount each frame. But I figured I would ask here before I started on anything because I am sure its a common problem with a common solution.
So, any advice?
I haven’t quite gotten my animator to create one of these yet, but what I thought I’d do was the following -
rootBone.parent = null;
characterCollider.SetFollowAveraged(rootBone);
animation.Play("vault");
yield WaitForSeconds(vaultLength);
rootBone.parent = characterCollider;
characterCollider.UnsetFollow();
SetFollowAveraged would instruct the char-con to try to move according to the average movement of each bone in the rootBone hierarchy (meshes need to not be in that hierarchy, or be skipped in the calculation). Expensive function, but since it just runs for a little while it might be acceptable.
Actually, SetFollowAveraged could just be given a hierarchy of both hands, both feet, and the head, and might perform just as well… I dunno. 
You might also speak with your animator about adding an additional bone above the root bone (new root bone), leaving that one in place, and just animating the old root bone (so, no animation change, just a higher-up bone). You could then read the animation data in your code, remove the movement of the old-root-bone and move only the character’s physics representation to animate the vaulting animation.