How to detect the next face in a direction


basically I’m making my own dynamic ledge grab system and I want to know the most OPTIMAL way you guys THINK of, for example I wanna know if somehow I can get the normal face of a part using rotation.

If your shapes are predetermined, you could most likely just math this out but for dynamic and overlapping things, it may be best to use Raycasts. Excuse me for my paint drawing but something like this.
kuva
So when starting to move to a direction, you should first cast a ray to that direction, if there are no hits, you fire the second ray more inwards, toward the normal the player is currently facing. With this you can get your possible edge cases of hitting a wall and in cases where there is no direct wall on the side, your second cast will get you the normal you are looking for (extra cast should be done to try get the top surface)

Hope this comes as useful :smiley:

lol that’s what I have so far, just for reasons I’m trying to find a more consistent method

If you want more accuracy, just fire more rays :smiley: Around all edge cases haha