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 Doddler · Jul 19, 2011 at 05:31 PM · animation3dblending

Animation Blending Issue

So I'm having a bit of trouble with getting animations to blend together. Right now I'm blending the second animation like this:

 animation.Blend("secondanimation", 1f, 0f);
 animation["secondanimation"].blendMode = AnimationBlendMode.Additive;

This works really well, but when the first animation stops, the second one breaks outright. At the risk of overly simplifying the issue, is there an easy way to use additive blending for animations and not have them break when there are no normal animations playing?

Here's what happens right now: video. At 5 seconds, the second animation starts playing (the eyes move). At 11 seconds, the base animation stops. As you can see, it starts doing very strange things to the additive blended animation.

I'm not sure if I'm doing it wrong, or I'm missing something simple. There are a couple solutions that I could think of, like blending with an always running 'idle' animation, or keeping track of animations and shifting blending types, but neither sound like very good solutions. Are there any other ways to make it work well?

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 Owen-Reynolds · Jul 20, 2011 at 04:53 PM

The "always play looping base" seems to be the most official answer.

What I got from the big animation docs was to use layers to control combining/fading. Unity wants to play only 1/layer (CrossFade stops all on same layer. I think ani.Blend is a hack to break that rule.) The vanilla solution seems to be:

o Layer 0 (the default layer) has all of the "forever" animations, like a looping walk, run, dance, idle, 2-frame looping "frozen" to keep Add happy, falling... . You'll CrossFade into the new one, letting Unity automatically stop the old Layer0 one.

o Layer 2 (leaving layer 1 unused, just in case) has non-repeating animations, such as your entrance. Many of these will be some bones only (AddMixingTransform,) such as toss grenade. Some might be add animations. You can CrossFade these without thinking about the layer0 animation. Unity will auto-blend in and out for you.

o Layer 4 (saving layer 3 just in case) has all looping eyestalk animations, which will be either "eye bones only" or Adds

o Layer 5 has all non-looping eyestalk only, which can be played, will "cover" the looping eyestalks, but will revert back when done.

o Layer 6 has all front claws animations.

o etc...

So, play an actual knee-flexing idle (which is on L0) and CrossFade "entrance." Entrance wins (on L2, a higher layer,) but when it finishes, it autofades into looping knee-flex. That idle isn't just something to make Add happy -- you want it playing invisibly in the background, so you're auto-playing something after entrance finishes. In theory, Unity notices looping knee-flex is completely covered by entrance, so does no work computing anything for it until entrance ends.

Say you crossFade in the looping eyestalkWiggle after your 5 secs, but then you see a shark. All you do is CrossFade in eyestalkScared. That auto shuts off the eyeWiggle, but leaves entrance/idle unchanged.

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 Doddler · Jul 21, 2011 at 02:47 PM 0
Share

Thanks for taking time to reply. The type of animation blending I plan on doing isn't really too complex, although using layers would probably help out a fair bit. I ended up using Blend for my test since it's the only one I got working, but using layers should work. When I tried it, it would just tend to overwrite the base animation or break, but I have a feeling I was just not using the correct combination of settings.

I guess in all cases though, I'll need a looping base in order to make proper use use of blending. Thanks for the help. :)

avatar image Owen-Reynolds · Jul 23, 2011 at 03:14 AM 0
Share

The three ways of "blending" are 1) Additive, which requires another, which may as well be looping; 2) real blend, by setting weight of upper to <1, which is pointless without a base, which may as well be looping, and 3) partial (Add$$anonymous$$ixingTransform,) which is fine with no base, but then the rest isn't moving, so why not have a base..

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

How Can I Get The Pants to Not Move? 4 Answers

Menu Movements 1 Answer

Making Character Stand? 1 Answer

Animation flashlight when run 4 Answers

Animation... Unity 3D...Blender...3rd Person 2 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