Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 DanielErhardt · Dec 16, 2015 at 12:24 PM · animationblend tree

How can I use Blend Trees to blend animations at random?

Hello,

I'd like to know if it is possible and how should I proceed to blend smaller animations into the main ones randomly.

The project of the character in question, for instance, has a characteristic where his muscles twitch randonmly.

What I'd like to do is to create small animations for each of his limbs shaking, and then blend them at random while he is walking or idling.

I know I'll have to create a script to control this randomness, but I have no idea on how to proceed with the blend trees. If it is even possible to do it this way.

Can you enlighten me on where I need to start?

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
1
Best Answer

Answer by Baste · Dec 16, 2015 at 12:35 PM

The best would probably be to use additive animation layers.

Have the twitch animations in their own layer, and set it to be additive. Have that layer play an empty animation most of the time, and then blend it into the twitches at random intervals. That'll give you the effect without making your main animator controller messy. Note that there's some things that are not intuitive about additive animations, see here.

An alternative would be to have the twitches controlled by blend shapes, and then animate those randomly outside of the animator controller. Blend shapes are a bit clunky to work with, but it's doable. You get/set the blend shape weights with SkinnedMeshRenderer.Get/SetBlendShapeWeight, and find the count and names with Mesh.blendShapeCount and GetBlendShapeName.

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 DanielErhardt · Dec 17, 2015 at 09:41 PM 0
Share

Wow. Just wow. I didn't even know those additive animations were a thing. They made things so much simpler.

Thank you Baste, that really helped me!

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

2D: initial sprite idle animation playing too fast upon game initiation until I input movement keys? 1 Answer

Dynamic thresholds runtime C# 1 Answer

How do I set timeScale with Animation API? 0 Answers

2D 8-directional enemy AI sprite animation with Blend Tree not using correct animations 0 Answers

Walk/Run right animations seem hard to come by 1 Answer


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