Hi guys,
I kinda got it to work fine but it seems like my "pointing" arm can point toward mouse if mouse y position is higher than my player.
In other words, my arm can go up but cannot seems to point toward the floor... :doh:
I guess it has something to do with my "in spine editor" ik setup, but what am I missing here ?
my function looks like this :
void SetArmDirection (ISkeletonAnimation s) {
float scaleX = targetDirection.x < 0f ? -1f : 1f;
transform.localScale = new Vector3(scaleX, transform.localScale.y, transform.localScale.z);
if (isAiming) {
myIkConstraint.Mix= 1f; //previously set up
Vector2 handPointLocalSpace = skeletonAnimation.transform.InverseTransformPoint(Input.mousePosition); // hand direction
myIkTargetBone.X = handPointLocalSpace.x * scaleX;
myIkTargetBone.Y = handPointLocalSpace.y;
}
}