- Home /
Animation - Cover Up Another (Legacy)
Hey,
I have a few animations that I want to utilize such as Attack, Run, etc.
Initially I tried layering / blending (I probably messed it up a bunch) but it didn't yield desired results.
The thing is, these are whole-body animations, meaning that the run animation will use the leg bones as well as the chest bones as well as the arm bones. The attack animation will use the same bones, but put emphasis on the arm bones.
You will also be able to attack while running, and in that case:
Arm bones will be Attacking
Leg Bones will be Running
Chest / All other bones will be Attacking
MY SOLUTION was to make a class that identified each of the bones, used AddMixingTransform() on whole animations, and used RemoveMixingTransform() on animations when they were to be covered up by another. It works, yes, but let's just say that there's quite a bit of work left to make it anywhere close to finished. I've been too scared to implement the actual states yet.
Is there an (easier than my solution) way to make this happen?
Thanks for any input!
Answer by OllyNicholson · Mar 07, 2014 at 11:03 AM
Yes the easier solution is to use the Mecanim animation system (not legacy) and control your animations with states and layers so that you can mask different parts of the body to override or blend, this is precisely what it was designed for. Further documentation is available here:
http://docs.unity3d.com/Documentation/Manual/MecanimAnimationSystem.html http://docs.unity3d.com/Documentation/Manual/AvatarBodyMask.html http://docs.unity3d.com/Documentation/Manual/AnimationLayers.html
Your answer
Follow this Question
Related Questions
Why Do Legacy Animations Always Snap? 0 Answers
Distribute terrain in zones 3 Answers
Animation Doesn't CrossFade At End 0 Answers
How to play animation (C#) 3 Answers
Animation editing help? 0 Answers