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:
but not helping, Can anyone please put your suggestions to solve this issue. Thanks
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.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
18 People are following this question.
How to access Blend Tree "speed" in Mecanim from C#
How can I access Human Avatar bone and muscle values from a script
Mixing Unity Mecanim and Scripted Bones/States
Distribute terrain in zones
Mecanim, Inverse Kinematics, and the HeadLookController