I'm trying to rig a humanoid low poly character in Blender 2.82, starting with its legs. For this, I've been following two different tutorials on YouTube but they fail me at the same point :
Rig ANY Character for Animation - Easy Character Rigging with IK
Everything is going well up until I try to set the pole target. At first, there's this pole angle issue when I first select the knee pole bone. The leg is not facing the pole target but I understand that I can fix this by changing either the pole angle in the IK constraint window or changing the roll angle of the bone in edit mode so its x-axis is facing the pole bone. OK. But once this has been fixed, the whole leg behave weirdly, meaning it doesn't bend on the hips/heel/knee plane but rather unrestricted while it's not the case in the tutorials.
I sense I'm not far from the answer, just missing some key elements. You can download the blender file here.
EDIT : I tried to align the bones in my leg like moonboots suggested but it doesn't change a thing. Am I looking for some magic spot that makes everything go like it should ?
I'm not even sure I'm trying to solve an existing problem so let me be clearer : the issue is that I would like to lock the bending of the leg on a plane. You can see on the video here that I've modeled a blue triangle which has each of its angles on the knee, ankle and pole target resting positions. You can also see that when I bend the leg, it goes haywire, not staying on that plane at all.
Am I trying to solve something solvable ? Is solution still resting in the alignment of the leg bones ?

