Creating A Ledge Grab in Unity

This mechanic will let the player to make a ledge grab when jumping from one platform to another

First, download the animations from Mixamo (Idle, Jump forward and Hanging Idle)

In the player, create a ledge grab trigger gameobject (cube) as a child, some like this

Also create a cube to be a Ledge grab checker in the next platform

Ledge Grab

Create a LedgeChecker script to be attached to the gray cube above. It will check it other in OnTriggerEnter is Player.
If so, it will try to GetComponentInParent<Player> and call its GrabLedge() method. That method will disable the controller . Also, in the animator, create a bool bool grabLedge for the transition from JumpForward to HangingIdle and in GrabLedge() in Player, set the bool to true

For putting the player in a good position, test it out in play mode and copy the values
Create a Vector3 handsPos in the LedgeChecker gameobject and set its values in the inspector. They will be used by the GrabLedge(Vector3 arg) method

Climb up

  • Download a climbing animation from Mixamo, set its Rig values in inspector (Humanoid) and create a new Animation state in the Animator
  • Create a trigger climbUp
  • Create a transition between HandlingIdle and ClimbUp animations with climbUp trigger as parameter

Unity developer