Locking a player's cframe on the part

I’m making a ledge climbing system but you are able to grab onto ledges sideways, so I wanted to find a way to make the character face the part straight forward no matter the way they face the camera towards the part.

Found this on the forum