Is my Inverse Kinematics not working correctly or is it working correctly? Here is how it looks like when it is on the ground.



Here is how it looks like when I move the bone up along the z axis. As you can notice the yellow bone moves to the right a little. How do I fix this? I want it to NOT move left nor right, but just simply up.

(Note that I have not done any weight painting yet so for now I am not trying to control the body with the bones)



This is how I have setted it up

Or is everything working the way I wanted to and there is no mistake?
If you make a 2 step vertical IK chain (controlled by a target bone), without any pole bone, and then in edit mode you move slightly the "knee" forward, in pose mode the bending of the chain will follow this slightly moved direction (tipically forward).

With a pole bone you can further control the direction of the bending.



Make sure that as seen in the image, the resting armature's knee (in edit mode not pose mode) is forward of the rest of the leg, ie: bent forward just a little. That way IK will bend it in the right direction.