Using IK for interacting with scene objects
Sometimes our characters need to interact with objects in the scene. Most likely we will need to have a solution for picking up items from the ground or other objects. This recipe shows a simple solution for that.
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
How to do it...
To use IK to interac with scene objects, follow these steps:
- Import the character to Unity. Make sure to have the
Idle
andPickup
animations and set the rig...