Any way I could make legs locked at a certain rotation?

So I’m trying to make my animations better and I came across a hurdle. I can’t figure out how to lock the players legs in place when they turn their character.

I am trying to replicate this look from garry’s mod and i can’t really figure it out. V

Any known methods for this?

they are definitely using inverse kinematics for the knees

to modify leg rotation, you can set the cframe of the leg joints to Torso.CFrame:Inverse() and then multiply by your own cframe

then just rotate when the y angle difference between the torso and the leg exceeds some amount, and then reset to the new angle