|
Post by bluemana on Jan 11, 2017 3:47:00 GMT
I'm using a standard Melee Character rig, with the standard scripts, and a MatchTarget call on a custom animation. When I use the same animator controller on a non-Melee character, the match target works fine. When I try to use it on the Melee Character rig, the x and z positions match up during the animation, but the y does not; the character ends up at the same y position no matter how high I make the target's y coordinate. I've tried looking for anywhere that the y would be overridden in script, but can't for the life of me figure it out. Any insight is most appreciated.
|
|
|
Post by Invector on Jan 11, 2017 15:56:32 GMT
Take a look into the documentation: docs.unity3d.com/ScriptReference/Animator.MatchTarget.htmlBasically you could filter using the MatchTargetWeightMask to specify position and rotation weight mask, for example our climbup animations use: MatchTarget(matchTarget.position, matchTarget.rotation, AvatarTarget.LeftHand, new MatchTargetWeightMask(new Vector3(0, 1, 1), 0), 0f, 0.3f);the (new Vector3(0, 1, 1) means 0 x, 1 y and 1 z, it will ignore the X because I want to climb and get up at any X position, but it will take the Y and Z position to matchs the height and distance of the target.
|
|
|
Post by bluemana on Jan 30, 2017 13:25:22 GMT
Yes I'm well acquainted with the MatchTarget method; my problem is that for this particular instance, when I match target on a basic rigidbody/capsule collider character with a simple script it works fine, but on the Invector rig it is not acting the same, the animation does not line up. It seems as if something in the Invector script is interfering with the MatchTarget but I can't seem to figure out what that might be. Thanks,
Michael
|
|
|
Post by Invector on Jan 30, 2017 15:01:59 GMT
Hmmm perhaps the rigibody/collider is interfering? notice that we need to turn off those components in order to climb up or jump over something, otherwise the rigidbody would keep pushing the player down when climbing or the jumpover would not complete.
|
|