How can I make a raycast detect a ledge?

how would i be able to make a raycast that starts from the head forward and another that starts from the torso and if the raycast of the torso collided with a part and the raycast of the head did not, then detect a ledge and if the player presses space, it makes a vault (sorry if that wasnt explained very well)

edit: ive found a fix