Matrix collision system - HELP!


Hello! So i have a character with a skirt and i would like to make the leg collision with the skirt. So i made a basic matrix collision system but it doesn’t work correctly. This is how it is currently working:


I put a plane in front of the leg because i thought maybe it would be a problem that the mesh with which the joint is colliding is the whole body if i only want one leg. When i replaced the body mesh with only a plane the system worked a bit better but it’s still doing that weird thing.

If anyone has any suggestion it would be greatly appreciated.

You can check out the file here:

Thanks a lot.