Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by verenion · Aug 08, 2013 at 01:47 PM · weaponavatarmechanim

Character Bone structure and adding weapon to hand

I'm not sure if this is a unity bug, I'm doing something wrong, or if I am doing this the completely wrong way.

My goal is to have a character (using mechanim for animation) with a standard bone structure. This far is easy, and I have all the animations working. I now am working on my weapon system - the player should be able to 'hold' a weapon in his hand. I first thought to use a script that takes the Hand bone, and takes the object I want to hold (a gun, knife, cup of tea etc.) and simply do something like the below:

 cupoftea.position = hand.position;
 supoftea.rotation = hand.rotation;

This isn't perfect, as the position and the rotation would need to be offset - but the bigger problem was the delay - when the player brings his arms up to aim, the gun sort of lagged behind - not ideal.

The better way to do this, would be to use simple GameObject parenting, as this seems to be far more efficient than using a script and generally works better.

My character has a bone called Spine2. When the bone is selected, it is in the correct place (in the center of his chest). (sorry, can only upload two images - take my word, without the gun, the bones are all fine)

So, I add a gun (just a simple model of an M9 to test) to the hand bone, and relatively align it so it looks right (this could be done very simply for each weapon in code when changing weapons).

alt text

Now the weird part that is throwing me off - when the gun is added, the spine2 bone (along with several others) move out of alignment, and most of them seem to move to the gun's location.

alt text

I have noticed something after writing this, in the editor, if I change to pivot mode, the bones look correct, it seems to just be the center mode they are wrong.

So, my question(s) are:

  1. Can I just leave the bones like this? For now, it seems to work okay, but I'm not convinced that is right.

  2. Im I doing this the correct way? Is there a better way for a character to hold a weapon?

screenshot_2.jpg (28.0 kB)
screenshot_4.jpg (27.0 kB)
Comment
Add comment · Show 3
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 verenion · Aug 12, 2013 at 02:22 PM 0
Share

bump. Anyone?

avatar image chronicfail · Aug 12, 2013 at 04:25 PM 1
Share

I have this problem too- again when putting guns in hands, except that it stays wrong in pivot mode. I don't know how to solve it, but it means it's not just you with the problem. Also, the model I am using has worked before without a problem so it is not the model's fault.

avatar image verenion · Oct 09, 2013 at 10:39 AM 0
Share

It might just be a visual bug, as the rotation and position of the bone seems to work okay.

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.

Follow this Question

Answers Answers and Comments

15 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

Related Questions

How to use AvatarBuilder.BuildGenericAvatar() ? 0 Answers

I can preview the animation but in scene it doesn't work 0 Answers

Is there no way to create Avatar and AvatarMask for Transform trees? 0 Answers

Removing Bone From Hierarchy Animation/Bone Rotation During Animation Problem[Humanoid] 0 Answers

Adjust/Change AvatarMask at runtime? 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