We have been using Mecanim and root motion animation to move a generic rig character in predetermined paths around a world. In order to do that and get him to actually stop on the end waypoint, we have had to calculate the stopping/braking distance, given a set linear deceleration and the transition to idle at the end. The problem is, it would seem that the root motion resulting from the blends is non-linear, regardless of the blend type, resulting in quite a large positional error at the end of the movement.
To verify, we have created an animation clip of a cube sliding by 1 unit and set up a blend of that clip, with control points at 1, 2, 5 and 10, running the clip at 1x, 2x, 5x and 10x speed respectively.
The actual resulting speed of the root motion, as found by integrating animator.deltaPosition or the actual position in space, is pretty much spot on on the control points and pretty far out half-way between. I have attached a couple of graphs that illustrate the problem.
The question is, are we using this the right way or have we conceptually misunderstood something? We could discretise and calibrate the errors away but would this be the right way to go on about this?
Edit: Does anybody have any information about what kind of interpolation is applied to the animation curves between points on the different blend trees? This whole problem would be much easier to solve if it was not such a black box we have to calibrate errors away from and we seriously can’t help but think that we are missing something!