If you're using this for detecting edges around a player, use Region3 to get all the parts around you. Go through the table region3 returns and you would have to do some math to find all the edges. There are 12 edges in a cube/rectangular prism so we need to find 12 edges. I'll give an example of finding one of those edges
local edge = {Vector3.new((part.Size.X/2)+part.Position.X, (part.Size.Y/2)+part.Position.Y, (part.Size.Z/2)+part.Position.Z), Vector3.new((part.Size.X/2)+part.Position.X, (part.Size.Y/2)+part.Position.Y, (part.Size.Z/2)-part.Position.Z)
Here is a image showing what we just did http://imgur.com/2pS20ds
You would have to do that 11 more times with different math to get all of the edges
If you want to know if the player can grab on to the edge, use raycasting and see if they can see the edge (I'm not 100% sure on how you would do this part). Insert all of the edges into a table and boom. you got yourself a table of edges my friend.
About the raycasting part. Like I said I'm not sure how you would do this but you would want to find the closest position on the edge to your player and raycast from your head to that position. I don't know how you would attain that position.
Sorry if this is poorly written or anything, if you need clarification feel free to comment
1 comment
The raycasting part is not necessary if you just want to find the edges