Edge grabbing and climbing

Hi! I am trying to make a platforming game where the player can grab and climb the edges of the platforms. So far, I have not been able to implement any kind of reliable way to detect the edges… I tried to raycast a trigger near the edge to check if the character is in grabbing distance, but it doesnt work properly…

Any ideas? Any article/material you could recommend reading?

Thank you for your time.

If you are using Mecanim you can use its IK feature along with triggers as shown in the following video (this link should take you to the point where they demonstrate a character climbing up a ledge which seems pretty similar to what you want).