Need help with flipping of CCDIK joints

Godot Version

4.6.1

Question

So in the game, when the mouse goes to one side of the player, the body and arm flips to the other side(I used TwoBoneIK for the arm). I’m using CCDIK for the constraints option it has, since I want nicer looking walking stuff. The best way I could find to flip the legs was by multiplying the min and max angles by -1 upon flipping, which works most of the time but when I flip over while moving, the leg gets stuck in an awkward position until flipped again.