What are some of the tricks to getting the ledge hang to work?

I recognize that video mentions things like having to fiddle with the collision boxes and the like, but I’m having no luck with this so far. I’m not getting any event for the ledge detector detecting the ledge. I know at least part of the box collider for the house is working, because the window on one side can be jumped on while the other side, I can jump through it, but there’s no grab of the edge. Is there a good way to create a simpler scenario so that I know whether it’s a matter of the colliders being in the wrong place, or me having coded things wrong?

Check these

  • Make sure both colliders are on the Ledge layer
  • Make sure both colliders are triggers
  • Make sure you are using OnTriggerEnter() in the LedgeDetector script
  • Make sure your ledge detector game object on the player has a rigidbody

Put a cube anywhere, set the layer to Ledge, make sure it’s high enough for your ledge detector to hit it when you jump into it, jump into it.

Adding the cube got me to realize I had an incorrect hanging animation name, which meant it was erroring out trying to move into the Hanging state. Hanging works on the new cube, but not yet on the ledge. I did check for your four points and they’re good. Still not able to hang off of the side of the building so far. The debug lines for hitting the Collider and running HandleEdgeDetect trigger for the new box, but not for the house ledge.

Unfortunately, I’ve had a very busy weekend. so I only had a chance to put about a half hour in today, and I need to head off to bed so that I can rise early for my primary job. :smiley: I’ll do some more fiddling with it tomorrow after classes, hopefully.

Ultimately, a lot of fiddling is the key to success here. Take advantage of all of this tool to view the colliders from every angle to get it exactly where you want it.

Privacy & Terms