I have an animation of a character climbing with root motion in it (i.e. the character moves generally upwards for a couple of units during the animation). It is intended as a one shot, not a loop. The skeleton is fairly standard hips > spine 1, hips > right leg, hips > left leg etc. The root is the hips and the pivot is between the soles of the feet.
I know its generally best to make in-place animations without root motion but scripting the upward movement using Vector3.Lerp etc looks unrealistic (in reality when rock climbing for example the upward motion will come in perdiodic bursts as the knees are first bent, then extended, rather than a constant movement upwards), so I want to keep the root motion in the animation.
Problem is when the animation has finished Unity still considers the transform pivot to be in its original location, before the skeleton climbed up two units. Is there any way to instruct Unity that the new transform position is where the characters feet have ended up after the animation has finished?
I figure I could parent the hips to an empty which moves the charaters around normally, detatch the empty before the root motion climb, move it by the same amount the hips moved then re-attach but is there a less hacky way? Some kind of
transform.returnToOriginalOffset method perhaps?