• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Rubikpotato · May 14, 2015 at 02:55 PM · animationweaponrigginghandsarms

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

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)
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rubikpotato · May 14, 2015 at 10:59 PM 0
Share

I tried this and ak-47 displaces out of hands, and floats during some animations. Still hard to sync.

avatar image
0

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.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rubikpotato · May 14, 2015 at 04:21 PM 0
Share

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.

avatar image Cherno · May 15, 2015 at 01:38 AM 0
Share

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.

avatar image Rubikpotato · May 15, 2015 at 01:51 AM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

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.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Is there a Mecanim callback for, "Where X bone would be if IK was off"? 0 Answers

Mechanim animation problem: Why aren't my character's hands moving? 0 Answers

animation arms and berreta controll 0 Answers

Anima2D Skinmesh squashing and stretching 1 Answer

Can I make animations snap to a frame? 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges