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 Evil-Lemons · Jul 06, 2014 at 06:19 PM · animationmecanim

Mecanim add weight to certain animations

I have an attack animation. This animation needs to play no matter what, over all idling and walking. I made an AnimatorController that controls the idling, walking, blocking, and attacking. A variable, isAttacking, controls when the model plays the attack animation.

The attack animation works - it plays when you are idling. However, when you are walking, most of the time it doesn't play.

Here's the AnimatorController:

alt text

And here's (the important parts of) the script that governs it (Boo):

     import UnityEngine
     
     class PlayerAttack (MonoBehaviour):
     
         private animator as Animator
     
         def MeleeAttack() as void:
             animator.SetBool('isAttacking', true)
             Invoke("StopAnim", 0.1)
     
         def StopAnim() as void:
             animator.SetBool('isAttacking', false)


To make the attack animation play no matter what, is there a way to add weight to that animation specifically?

If not, is there a workaround?

Thanks in advance

animatorcontroller.png (59.3 kB)
Comment
Add comment · Show 2
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 meat5000 ♦ · Jul 06, 2014 at 06:20 PM 0
Share

You can add weight to the layer with this. Check your transition from Walk to Attack. Consider placing Attack on a higher layer with a $$anonymous$$ask to walk whilst attacking.

avatar image Evil-Lemons · Jul 06, 2014 at 06:44 PM 0
Share

But if I use layers, can I make transitions from certain animations across layers?

That is what was stopping me beforehand.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Mecanim animation and scripting problems 0 Answers

Make animated character's hands steady 1 Answer

Pistol Aim prolbem style = Tomb Raider??? 0 Answers

Best way to go about believable 2 Character Grab/Lift animation? 1 Answer

Error getting animation info with Animator 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