Character gets stuck when walking on ledges

I ended up fixing the issue. by using the FindFloor function whatever the player is on the walking state and setting his movement mode to falling when it returns false ( which essentially is the case i had, the character was still on the walking movement mode but wasnt getting his physics movement mode set to falling for some reason )