Capsule collider flinging character off ledges(same problem Unreal Tournament had, apparently)

I am facing a rather annoying problem, where the capsule collider flings my character off ledges, seemingly redirecting momentum when some force pushes the round bottom of the capsule against a ledge. I found this forum thread from the UT4 forums and it’s the exact issue I am facing. If you watch the videos they posted, you will know exactly what is going on.

I have a good idea of what’s causing it. The culprit is the SlideAlongSurface() function, which is redirecting momentum. When walking off ledges, like in UT4’s case, it happens because gravity pulls the character down, but then the SlideAlongSurface() function redirects that force at an angle, causing it to “bleed” into the perpendicular direction. This effectively accelerates the character forward.

In my game, walking off ledges does cause this issue, but it isn’t the main problem. My main problem is that when you attempt to jump UP a ledge from directly underneath it while pressing forward against the wall, the SlideAlongSurface() turns the player’s forward request into an arch trajectory. This makes edges feel like they launch the character.

I am currently trying to think of good solutions to this problem other than using a box collider. Switching to a box collider this late would require quite some changes. Any ideas?

Thanks for your time.

you could compare the height range of the center of the collision capsule and the slidealongsurface function. if the impact collision point is too low on the height compared to the center of the collision capsule you can ignore it.

or add 2 box collisions, one around head and one around feet if you dont want to change main collision object