- Home /
Question by
infinitypbr · Jun 23, 2013 at 09:21 PM ·
mecanimik
Mecanim IK -- Usage?
I have these lines:
var goalRotation1 : Quaternion = Quaternion (transform.rotation.x - 90, transform.rotation.y, transform.rotation.z, transform.rotation.w);
enemyAnimator.SetIKRotationWeight(AvatarIKGoal.RightHand, 1);
enemyAnimator.SetIKRotation(AvatarIKGoal.RightHand, goalRotation1);
This "works", in the sense that something happens, but it's not at all what I expected. The right hand holds a bow, and instead of the entire hand just moving -90 degrees on the x axis, it looks like the hand skips between bent and straight. The rest of the skeleton does not follow through.
The goal is to get the hand, which holds the bow, to point towards the player. Right now, when the enemy is facing the player, the bow (and shooting animation) always points to the enemy's right.
I have never used IK anything before, so I suppose I may not understand what this is for :)
Any ideas on how to fix my code, or what I Should be doing instead of this to achieve my goal?
Comment