Player Ledge Grab (part 1)

Adding the ability for your character grab the edge of platforms

Simon Truong
3 min readOct 5, 2021

--

Time to add the ledge grab system, the iconic hanging off the cliff and pulling yourself up. The logic behind the ledge grab system works entirely different from what we normally would assume. We will have two box collider which will check whenever these two object will contact each other. When they do make contact the player is going to freeze the gravity, snap toward the ledge and give the player the option to press a key down which in turn move the character up and across to the top of the platform. This will all be hidden behind the smoke and mirrors of animation.

Setting Up the Ledge Grab Checker:

First we need to import the ledge grab animation, by now you should know the procedure in downloading from Mixamo and importing the animation clip to your Animator. Next we are going to set up the Ledge grab Checker, this checker will follow the player. Create a 3D cube object and make it a child of the player, then adjust the size and position to fit it right under the Players hands. To get the checker to properly align with the hands, we need the player to be in the hanging pose, therefore we can create an simple Trigger parameter to toggle the animation manually.

Adding the parameter toggle and making the transition starting from the any state to Hanging state.

Play the game and adjust the 3D checker cube to fit just under the hands like shown below. Since you are in play mode any progress that is done will be reset once you exit, therefore you can convert the player game object into a prefab before you exit the play mode to save the settings assign during the play mode.

Creating the Ledge Grab Checker

Setting Up the Ledge Checker:

Now it is time to create the other collider that belongs to the platform, as suggested earlier, this checker would check whenever we make contact so we can toggle the hanging animation etc.

Select the platform and highlight the ledge, we are going to create another child object very similar to the grab checker in the player.

Creating the “lip” of the platform so the player can grab onto

Once you have created the ledge checker, we need to test out the position to see if it does indeed collide with the player grab checker. Continuously check and refine until the player does indeed hit the ledge checker.

Testing to see if the colliders to make contact.

In the next article we will focus on freezing gravity and making the player latch on to a certain location on the platform.

--

--

Simon Truong
Simon Truong

Written by Simon Truong

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.

No responses yet