Can Animator.MatchTarget and AvatarTarget be used for generic rigs?

Hi,

I want to “MatchTarget” an animation to a target point using Animator.MatchTarget and AvatarTarget, like this (according to the mecanim animation tutorial):

var anim:Animator = GetComponent(Animator);
[...]
anim.MatchTarget(hitInfo.point, Quaternion.identity, AvatarTarget.Root, new MatchTargetWeightMask(new Vector3(0,1,0), 0), 0.6, 0.76);

I am doing this for a model that was imported as “generic rig”, i.e. the Avatar is only a generic one, with no specific bone assignments inside Unity.

MatchTarget doesn’t seem to be doing anything: My animation just runs to its end, no matter where the object is located in relation to the target point.

Is this a natural limitation for generic rigs?
Or am I doing someting wrong?

I’ve already checked the following:

  • hintInfo.point seems to be valid and the expected position (according to the debugger)
  • start and end points (0.6 and 0.76) are also valid (I tried to change them to arbitrary other values between 0 and 1, which makes no difference at all)

Any helpful ideas highly appreciated!

An answer to my own question, as described in the comments above (thanks to EHogger for helping me):

Yes, MatchTarget seems to work for generic rigs.

I only misunderstood its function: It is meant for adjusting an AvtarTarget’s position and rotation, not for slowimg down an animation.