Code:
(1)
___
   |
   |  <-  player comes close to the wall, a c_trace from his origin detects the wall => (2)
   |
   |

(2)
 c_trace from for examples 64 quants above and in front of the player
  |
 \/
___
   |
   |<-player
   |
   |



If (2) c_trace is successful, the ledge is at target.z and x/y is your player's position or the previous target from c_trace in (1).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends