Sidescroller Ledge grabbing and climbing

Hi everyone,
I am building 3D SideScroller game and i am stuck trying to figure out a way to make the character grab a ledge by jumping to it and climb it by pressing Up button. i would really appreciate it if anyone helped me with that
thanks alot