How to grab, pick and place an object to other location using Mecanim IK Script

Hi,

I have learned about the script to reach an object in the unity using IK of mecanim,
but my requirement is listed below:

**1) Need to grab an object in the unity editor

  1. The object needs to come along with the character

  2. Then the character have to place the object anywhere in to the scene.**

I have checked the links:

**Unity 4.0 - Mecanim Animation Tutorial - YouTube

Unity - Manual: Inverse Kinematics**

but not helping, Can anyone please put your suggestions to solve this issue.
Thanks

I’m not sure what you mean by “grab object in the editor”, but aside from that you can:

  1. Create an IK script on your character, similar to the one in the demo.
  2. Activate the IK based on some trigger (entering the range of the object or what not).
  3. Lerp the IK weight until it reaches 1, which means you are at the object position.
  4. (optional) play some grab animation.
  5. Parent your object to the hand, and start Lerping back the weight to 0 (this will have the character holding the object, but now it will just follow your animation).
  6. Animate you character moving, the object will just follow.
  7. Start the IK lerp again, this time with the requested position as the goal.
  8. when it is at 1, release the object (unparent), and play any other animations you want.
  9. Lerp the weight back to 0, and turn of the IK control.