- Home /
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
2) The object needs to come along with the character
3) Then the character have to place the object anywhere in to the scene.**
I have checked the links:
**https://www.youtube.com/watch?v=Xx21y9eJq1U
http://docs.unity3d.com/Documentation/Manual/InverseKinematics.html**
but not helping, Can anyone please put your suggestions to solve this issue. Thanks
Hello all!
This is exactly what my project needs! Amazing! Any tutorials on this subject? Going to try implement this Thanks @skalev
Answer by skalev · Sep 18, 2013 at 07:57 AM
I'm not sure what you mean by "grab object in the editor", but aside from that you can:
Create an IK script on your character, similar to the one in the demo.
Activate the IK based on some trigger (entering the range of the object or what not).
Lerp the IK weight until it reaches 1, which means you are at the object position.
(optional) play some grab animation.
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).
Animate you character moving, the object will just follow.
Start the IK lerp again, this time with the requested position as the goal.
when it is at 1, release the object (unparent), and play any other animations you want.
Lerp the weight back to 0, and turn of the IK control.
What would be the best way to add a grab animation to the process?
Would that be to use masking? I put some animation but it's very jumpy, and at what stage should the animation play?
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Script only makes character run forward 1 Answer
How to access Blend Tree "speed" in Mecanim from C# 0 Answers
Mecanim, Inverse Kinematics, and the HeadLookController 0 Answers
How can I access Human Avatar bone and muscle values from a script 1 Answer