- Home /
Using SetIKPosition the final hand position is offset from target
Hi,
I have a character set to IK his hand to an object out in front of him. In this early stage I've just tried to duplicate the setup in the IK scene from the mecanim example package.
So I have the IK script attached and the limbs get assigned some target objects. Everything seems to work perfectly except the limbs always end up slightly offset from the target; the objects just kind of float next to the hands/feet.
I've tried bringing the character into the mecanim scene and it works fine there. The script is pretty simple and I've double checked all the settings (all the position weights are 1). I'm not sure what I could be missing.
I've tried replacing the target objects with small spheres and they have the same problem. It's really strange. Does anyone have an idea what could be wrong?
All I can think is that it is conflicting with something else in the scene or with my mecanim implementation.
Thanks for any help
Answer by MrFoamy · Feb 25, 2013 at 10:23 PM
I found the cause and solution for this.
The issue is that the character object as a whole was scaled to 1.3. The IK system appears to be assuming the rest of the world has also been scaled by this amount.
The example image here is actually incorrect, I didn't realise I had left a manual reduction of the X axis by 0.5. Without that the hand was floating above the target by quite a bit.
Resetting the scale fixed the IK problem, now I just need to work out a way to keep that with a bigger guy.
I also faced the same issue; and my character was parented to an object which was scaled to 0.25. Changed the scale to 1 and every thing worked perfectly. Thanks for the tip! Have been struggling with it for quite sometime!