Ledge Grab Help

Hello all, as the subject says I am looking for help making a character grab a ledge.

What i’m going for is not a system where you press a button to grab the ledge, but more of a super smash brothers style ledge grab, where when you are falling and come into a certain range of the ledge, you can grab it and then pull yourself back up.

I have used the search button and seen some helpful things, but it is all more of oriented as either hit a button to grab a ledge, or someone that already had a good base and just needed a little more help on it.

Any help would be much appreciated.

How about using a trigger that extends out past the edge of the ledge, and when the character falls through the trigger it plays the correct animation and attaches the character to the ledge.

I’ll give that a shot after i finish messin with raycast, thanks for the idea :wink:

I am also working on ledge grab. I am going to try it with a trigger. Right now I have a little box collider on the edge of the ledge I want to grab. Then I have

OnTriggerEnter(other : Collider)
{
 SendMessage("ledgeFall");
}
function DidGrab()
{
Animation.Play("ledgeFall");
}

I am told by some that quickly looked at this that it should Play the animation I need once he collides, but he isnt.
after I get the animation to play I will start trying to work on shifting his position to where it will look like he’s on it and stop his downward movement.
:slight_smile: if anyone could give me some inpute and some tricks that will help with this that would be great.
:smile: Thanks for the Help :smile:

Just an idea but what if it was based off the lack of collision? If the player is touching the floor nothing happens. Once he leaves contact with the ground, play the ledge grab script. Of course, you will need to handle cases like jumping and stairs, but in this case you will ledge grab everything, and not have to trigger your entire map…

This method is more suited for 2d platformers, but the idea should be the same…

@disdahobo Don’t know the rest of your code, but you don’t have anything that calls the function DidGrab(). SendMessage will call a function but it looks like you are trying to call the animation.

Also Animation should be lowercase. This is an instance function.