• 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by ApolloVision · Apr 29, 2014 at 12:30 PM · animationjavascriptmecanim

How to properly place a rifle weapon into the Character's hands and change pose?

Hello,

I am using the 'StandingAim' animation from the Unity's Bootcamp demo. At the moment I am using a simple rectangular prism as my Rifle model and it is parented to the right hand of the Character. I applied the 'StandingAim' animation to my Character, the arms and hands are in the same position/rotation.

However the problem is how to I make my Rifle (a cube stretched into a rectangular prism) looks like it is being held in my Character's hands? Here are a couple of screenshots to demonstrate what I am trying to do.

The highlighted gameobject is my Rifle.

Idle Stance

alt text

The rifle is a child of the 'hand.r' (right hand) and it does somewhat looked like it is held properly.

However...

Aim Stance

alt text

As you can see the Character is in Aim Stance. When the animation is played the Rifle is misplaced. But not only the Character is in aim pose but he is also idling (idle) at the same time, that means his body is swaying, arms trembling, etc like any person will do. I merged two animations (Idle and StandingAim) via Avatar Masks.

But what I just want to do is to have the Rifle placed on BOTH hands (left and right). Because it is parented to the Right Hand, I want it to stick in the Left Hand too so it does not look like the Rifle is sliding/floating/clipping in the Left Hand (because Left and Right Hands animates separately at different position/height/etc)Is there a proper way to do that? Tutorials? Documentation?

Another important question - What if I have a variety of weapons? Lets say Weapon A has a unique Aim animation and Weapon B also has a unique animation. How do I tell Unity that if the child of the Right Hand is 'Weapon A' to play "Weapon A Animation". Or when Right Hand has a child named 'Weapon B' to play "Weapon B Animation".

Also I might just use an empty gameObject to attach the weapon to the hand. For example: Right Hand -> empty gameObject -> Weapon

I write in Javascript. Free version of Unity. Thank you.

EDIT: I am using Mecanim, Raw Mocap Data asset and Bootcamp asset. All animations are converted into humanoid.

aim.png (70.1 kB)
idlestance.png (84.0 kB)
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

0 Replies

· Add your reply
  • Sort: 

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

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Mecanim not updating script when it switches state? 2 Answers

Adding mecanim animations to an AI follow script 0 Answers

Animation depending on the Int value 0 Answers

Attack Animation through Javascript 0 Answers

How to get the values of the animation? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges