Alignment of the Foot to Ground (Custom IK System) on Custom Character Doesn't Work but Works Perfectly on Mannequin

Alignment of the foot to ground (Custom IK system) on custom character doesn’t work but works perfectly on Mannequin

I followed this “Foot Placement IK TUTORIAL using Leg IK in Unreal Engine 4 - YouTube” tutorial perfectly and the result looks perfect on the unreal engine mannequin but once I add the exact same mechanic to my custom character, the foot clips a bit though the ground and looks like it points down. I’ve been trying to fix this for the last 3 days and have tried everything to fix it from multiple rigs to painting weights. I assume something is wrong with my character since it has no problem applying the alignment to the ground to the mannequin. I’m using Blender’s Rigify skeleton, I had to remove the extra thigh and shin bones for the legs to bend properly but I still can’t figure out how to align the foot bone.

I was able to solve the issue, I just replaced the foot bone in blender’s rigify skeleton with my own under the DEF layer.