rig problem: knees bend sideways instead of forward and backward The knees bend sideways instead of forward and backward(normal) I tried:
"Recalculate Roll > View Axis" but that didn't do anything. How to fix it?

I'm not sure how to embed the GIF:

Imgur
You need to set the IK Pole Target and pole angle. Follow JerryNo's answers How to IK rig legs and How to Set/Calculate pole angle of IK constraint