How do i detect the edge of a part

I am making a ledge climbing script and want to stop the player at the edge of the ledge but i cant figure out how to detect the edge of a part so the player doesn’t go beyond the ledge

what can I use to detect the edge of a ledge so the player cant go beyond it?

I mean, you could probably achieve this by using a raycast ,slightly to the right or left of the character (depending on the direction they are moving), aimed in the same way they are facing. If the raycast goes more than like 1 stud then you can assume they have reached a ledge.

There are probably better methods, but this is just the solution I came up with

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.