AddMixingTransform ??

Hi …
I made a FPS online game … but I still have this problem

I wanna mix many animations together , For examples:

stand + run + crouch + crouch_run just for legs

and stand + reload + shoot for the others

I used ( AddMixingTransform )

	animation["stand"].AddMixingTransform(RightLeg);
	animation["stand"].AddMixingTransform(LeftLeg);	
	animation["stand"].layer = 1; 
	
	animation["run"].AddMixingTransform(RightLeg);
	animation["run"].AddMixingTransform(LeftLeg);
	animation["run"].layer = 1;

	animation["crouch"].AddMixingTransform(RightLeg);
	animation["crouch"].AddMixingTransform(LeftLeg);
	animation["crouch"].layer = 1;

	animation["crouch_run"].AddMixingTransform(RightLeg);
	animation["crouch_run"].AddMixingTransform(LeftLeg);
	animation["crouch_run"].layer = 1;

but it’t work with just one animation.

I tried to put every aniamtion in a layer , but the same problem

I searched a lot but all the post was with one animation ( one for lower body and other for upper body )

please how can I fix this …

thanks…

Two separate concepts are getting confused here:

  1. Animation blending is when you blend between two or more animations on the same layer – for example, blending walk and run animations at the same time to produce a jog.

  2. AddMixingTransform is used to limit an animation to a certain part of the body – for example, to make the hand-waving animation apply only to the right arm. Often you put the full-body animations on layer 1, the upper-body animations on layer 2, and set the upper-body animations’ mixing transform to affect only the upper body. This way the upper-body animation doesn’t override the leg motion from layer 1. When you set a mixing transform, it only allows animation on that joint and all of its children (e.g., the right shoulder and all of its children, including right elbow, right hand, right fingers, etc.).

  3. Additive animation is another related concept. Additive animations only work on top of non-additive animations (never by themselves), and adjust the non-additive animations – for example, using an additive crouch animation with the run animation produces a crouched run. Additive animation usually goes on another layer, such as layer 3.

These concepts are discussed in detail here: http://docs.unity3d.com/Documentation/Manual/AnimationScripting40.html

For your FPS, you’ll probably need at least 3 layers:

  • Layer 1: (full body) Blend between stand and run (by setting their weights)
  • Layer 2: (upper body) Set the mixing transform to the upper spine or shoulders. CrossFade between shoot, reload, and aim.
  • Layer 3: (additive) Set the blend mode to Additive (see the documentation). Use for crouching.