I was wondering if there is a way to play two animation at once. One animation on the upperbody and one animation on the lowerbody. Something like “Fire” on the upper body and “walk” on the lower body. So the legs still walk while the gun is shooting.
You can add a mixing transform bone to the animation through script, which will make the animation only effect that bone's transform and all children of that bone.
(So for example, for an upper body shooting animation, you would add the upper torso bone that has all the other upper body bones as children of it, usually spine1 or spine2 or whatever). Like:
var torsoBone : Transform; //drag the bone here in the inspector</p>
function Start(){
animation["shoot"].AddMixingTransform(torsoBone);
}
You’re going to want to use Animation.Blend. Here’s an example of blending:
animation.Play(“walk”); animation[“wave”].layer=1; animation.Play(“wave”); animation[“wave”].weight=0.4f;