I am having trouble with the raycast for my ledge system, and would appreciate any help I can get. Thanks in advance!
I could still use help with this, so I’m bumping my post.
Need more of a explanation to whats wrong with it
So what it looks like is you need to detect 2 rays toward the wall from the player at slightly different heights from where you want the ledge to be registered as grabbable. If you shoot straight forward from the player it could register a wider ledge than you need because you’d be reading the distances at an angle to the wall.
Shoot the top ray from the player and compare the distance to the bottom ray. I’d round them to the smallest decimal place you want the player to be able to grab. Let’s use .01 as your ledge limit for this example.
If the top ray is .01 studs longer than the bottom ray then have it register as a ledge. If it’s smaller then you have no ledge.