Getting ready

In this recipe, we are using only two animations: Idle and Pickup. The second one makes the character pick something from the ground. You can go to the Chapter 05 Character actions and expressions\Recipe 07 Using IK for interacting with scene objects directory. You will find an Example.scene there. Open it, play the game, and press the space bar to see the character trying to pick up an object from the ground. You can move the object and play the game again. The character will still try to reach the object.

Character trying to pick an object from the ground

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.