So I am making an FPS character with a character model, and I am applying Animation Rigging IK for the leg. It is a typical 2-bone IK Constraint leg with a hint object and a target object, one located in front of the knee and the latter behind the foot. It works fine. The problem is when I rotated the entire character in the Y axis with mouse via script, it slightly deviates the position of the foot while an animation is running.
This is the how i do the rotation :
transform.Rotate(Vector3.up * mouseX);
#mouseX is the mouse input value
This picture above is the character, with an idle animation running. I then rotate the character around 90 degrees left and the leg deviates like this :
its as if the foot ik has a completely different pivot point than the parent objects. How do I mitigate this so the foots always align and that it rotates properly?