- Home /
Blending just the arms animation
I have a character that can run and stop to an idle, but I'd like him to pass a ball when you press a key. is there a way i can have the passing animation blend to just the arms so that if you're passing whilst running or while stationary things look fine?
Very new to blending animations, so if you could just let me know if its possible and point me in the right direction that would be super awesome
Thanks
Answer by Bunny83 · Jan 27, 2012 at 01:21 PM
Sure, all you need is AnimationState.AddMixingTransform and specify the bone / Transform.
Fantastic. Awesome. Thanks mate. Just the thing Ii was looking for. now just a quick follow up, if I declare the Add$$anonymous$$ixingTtransform as in the example
function Start () {
// Adds a mixing transform using a path ins$$anonymous$$d
var mixTransform : Transform = transform.Find("root/upper_body/left_shoulder");
animation["wave_hand"].Add$$anonymous$$ixingTransform(mixTransform);
}
Do I just then crossfade in the animation wave_hand as if it was any other animation? but cause I've set up it as an Add$$anonymous$$ixingTransform it will only mix in the joints I tell it?
Yes. The wave_hand animation now only controls the shoulder/arm/hand bones. Commonly you'll put a partial (Add$$anonymous$$ixT) animation on a higher layer and Play/Xfade. Then, for example, Walk playing on a lower layer will control the rest of the bones. Even better, when hand_wave stops, Walk will go back to controlling all the bones.
Yes, i forgot to mention the layers ;) You usually want to run both animations at the same time, just the upper / arm animation overrides the upper / arm part.
from the layers example, its putting the run and walk on the same layer, from this would it be smart to have most of my animations that i want to be playing fully on that layer, but then have animations like the wave_hand on the 2nd layer? or would it be smart to have every animation on a seperate layer?
"Similar" animations should be on the same layer. Functions like Crossfade always work on one layer so they stop / fade out any other animation on this layer and start / fade in a new one. Layers are mostly for animations that should be played at the same time and be mixed together in some way.