UE4 How to make my character detect the Cliff

I use a sphere trace by channel to detect the wall and I can make him grab the ledge. How can I do the same to detect the edge of the cliff when he is on top of it?

Guys, can you guide me to the right direction, I’m kinda feeling lost.

If you start the trace from a point in front of the pawn and go straight down and it DOESNT hit something past the character’s step down distance then you have a ledge detected. To make it easy you can add a socket to your pawn BP in front of the character and get that socket’s world location as tge trace start point and make the end point the same just with a certain amount subtracted from Z.