How to do it...

To be able to grab a cliff's edge while jumping, follow these steps:

  1. Import your character to Unity. Make sure your character can move and jump (follow the Making a character jump with 3-phase animation recipe if needed). The character should use a Rigidbody component for moving and jumping. You can still use root motion to move and steer the character.
  2. Place the character in your scene and make sure it has the Player tag set.
  3. You need to have a cliff to be able to grab its edge. Import a suitable model or use a Cube from the Game Object | 3D Object | Cube menu. The cliff game object should have a collider (Mesh Collider for example) because we use a Rigid Body character.
  4. Add a trigger game object (an empty game object with ...

Get Unity 5.x Animation Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.