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
1
Question by thiezar · Aug 21, 2013 at 09:46 PM · animationcharacterweaponworkflow

What is the better way to set up a character with a weapon?

I'm asking this to the more experienced. Let's say we have a third person game and our player character is a warrior with a sword. The warrior can draw his sword when troubles are coming or walk with his sword in the scabbard. How would you handle this? In particular my doubts are:

  • Should the weapon be a separate game object or should it be part of the character game object?

  • In case the weapon is a separete game object should it be parented to a character's bone or should it have its own animations corresponding to the character's animations?

  • Since the warrior can have the weapon in his hands or not, should I create a walk animation with AND without the weapon or should I create only one walk animation and then use an animation mask with the sword equipped?

  • It is better to use Mecanim for such things or should it all be strictly scripted?

  • EDIT: Now if the weapon is some sort of gun the warrior has a new state: aiming. He can aim in some direction when the mouse is moved. Should I implement this by scripting the chest bone rotation or by scripting a Mecanim blend tree between up, down, left and right aiming animations?

So what is the best and more efficient workflow for this common situation?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by instruct9r · Aug 21, 2013 at 10:12 PM

heya.. I woud do that this way:

  • I would do the weapon separated, because you might want to switch weapons

  • I would do an empty game object, position it correctly and then parent it to the wrist bone. You might even do for both hands, in case you need the character to switch the arms with which he/she is holding the weapon. Make it's own animations and it's own blendtree (If any) and activate them from script.

  • Since the weapon will be separate, you can just make one walk and one separate motion for holding the sword (Idle), just for the arm and the other animations, for using the sword (Hitting, etc) and then just mask the arms, to replace the animation when you activate some of the motions.

  • MM... what do you mean Mecanim or strictly scripted? You can't script the whole animation. Use mecanim for the layers of the animation and then call the separate animations by script..

of course this is how i woud do it :). I'm not saying that it's the perfect way...

  • List item

Comment
Add comment · Show 2 · 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 thiezar · Aug 22, 2013 at 09:07 AM 0
Share

That's definitely the way I would go, too. Thanks for sharing your experience. I have added a new question in the original post. Could you help me with that too? :-)

avatar image instruct9r · Aug 22, 2013 at 12:18 PM 0
Share

I think it will be better if you make 4 animations: Look Up, Down, left, right and then add them in a 2 blendTrees. up/down controller by the vertical and left/right, controlled by the horizontal mouse movement, or touch controller (If it's for touch device). This way you'll be able to make smooth twisting of the spine.

One thing i'm not sure about: Can we make animation node in the $$anonymous$$ecanim, where the animation is getting controller by a variable from 0 to 1, but ins$$anonymous$$d of getting played, to move at the desired value. $$anonymous$$eaning if we pass 0.4, the animation shoud go to 0.4, ins$$anonymous$$d of playing with a speed of 0.4 :)

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

16 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

Related Questions

Switching weapons animation with mecanim? 2 Answers

Character Equip Animation 0 Answers

Realistic weapon movement with the character 0 Answers

Animation system 1 Answer

How i can setup Character 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