Ledge grabbing method that doesn't require any additional colliders. (But requires every ledge to be a mesh collider)
I could've just made it with colliders but felt kinda special today.
(Doesn't work for ledges that are not perfectly going along the x or z axis & doesn't take height into consideration yet)
White rectangle are the boundaries of the triangle, red ray is a no hit, blue hit, green hit and the normal is pointing up. White sphere is the calculated grab point. (The one attached to player is a wall check sphere)
I also got rid of booleans for controlling the climbing and used an enum to control flow through the climbing process. Before I had a mess of booleans like onLedge, climbing and detectingLedge. Which was a nightmare to manage and debug.
public enum Mode
{
DetectWall,
Climbing,
DetectLedge,
GrabbingLedge,
Falling
}
On top of the above explained ledge grabbing and detection.
Next up are the animations which I fear are going to be a hassle.