#Simple Ledge Climb Need Help

1 messages · Page 1 of 1 (latest)

nocturne thistle
#

Hi, I am trying to make a ledge climb mechanic that will allow the player to hang and move along ledges. The overall script should draw a raycast from the player to the ledge, and if a ledge is present, another raycast will form along the normal of the game object in the upward direction. I have been trying to figure out how to calculate the distance between the hit point and the top surface of the game object. I tried creating an additional ray cast that increments on the y value so that it translates upward across the ledge to see where the top surface is, where the fingers would go. How can I find the distance between the hit point and the top of the cube?

https://pastes.dev/PvNeok5TZA

nocturne thistle
#

Here is a better visual representation of what I am trying to do. I'm trying to get the distance between the hit point and the top of the ledge height?