- Home /
Attach weapon to both hands?
Hi, How I can attach a weapon to both hands of my 3D character to follow along with arms animations? I tried by parenting an ak-47 to one hand, but it rotates with the hand and is like holding a pistol, and is pretty hard to "sync" the left arm to look like is really holding the weapon with both hand. The only thing I could really think to "fix" this thing out is to attach the ak-47 to both hands, but I don't know how. fast draw of what I want to do but what happens instead http://prntscr.com/74wmv0
Any help would be well received.
Answer by elelec · May 14, 2015 at 04:52 PM
You could make the weapon look at one hand's transform.position with
Transform.LookAt(Vector3 HandPosition)
I tried this and ak-47 displaces out of hands, and floats during some animations. Still hard to sync.
Answer by Cherno · May 14, 2015 at 04:11 PM
You need to implement Inverse Kinematics. Mecchanim has soem basic IK functionality built in, but from what I understand (never tested it myself) you'll be better off with coding your own solution or using one from the Asset store. The latter has FinakIK and SimpleIK for example. I use SimpleIK, it's only $2 and works as intended.
I actually have I$$anonymous$$ on the rig of my character, so I don't see how I can use I$$anonymous$$ to fix that issue with the "double holding" guns.
Use two empty gameObjects as reference points. Both are children of the weapon object. One is the pistol grip of the weapon, the other is the at the handguard. Rotate them so that they match the hand rotation at that point. You can also, depending on your 3D modelling program, do this inside the modelling application; Create dummy objects, link them to the weapon, and animate the weapon and both dummies for a firing animation (slight knockback, etc.). Anyway, the I$$anonymous$$ targets for your hands are now the two objects. $$anonymous$$ake sure to rotate the hand bones in LateUpdate() so they are equal to the rotation of the two objects.
Thanks but I didn't get the first part of your comment, also I tried looking for tutorials about that dummy thing for animations but I could not find any for Blender
Your answer
Follow this Question
Related Questions
Mechanim animation problem: Why aren't my character's hands moving? 0 Answers
animation arms and berreta controll 0 Answers
Is there a Mecanim callback for, "Where X bone would be if IK was off"? 0 Answers
How do i fix these misconfiguration errors on humanoid rigs? 0 Answers
Mecanim distorts 3D model 0 Answers