system
1
I have a walk animation and a gun animation. I want to be able to wield the gun, and walk at the same time. Is there any way to do this?
EDIT:
Please help me with the comment I just made on SilverTabby’s question.
You need to use Animation.Blend
By blending two animations together, you can achieve the result you are looking for.
Blending works by taking the bone movements of the first animation, and averaging those movements with another animation based on the weight value - creating a smooth result of the animations
Using blending, you can both walk and talk at the same time, or move from an active animation to an idle animation smoothly, and many other things.
note: 0 and X averages to X, so blending a head bob with walking will not make you walk slower
Three ways to continuously combine two animations. See the unity animation docs for examples. Either of the first two should work for you. #1 is easiest:
o Limit them (using AddMixingTransform) to various bones. Could play walk, and play gunAim over it (on a higher layer) limited to arms only.
o Add one to the other. Suppose walk has the arms in rest pos, but swaying a little; and run has them in rest, swaying more. Can set gunAim as as Additive animation, and play on a higher layer. You’ll get the walk arm-sway, with the gun aim added to it. Can also use the limit-to-bones trick. Problem with this is the animator had to plan for it.
o Blend/Average them. This plays them half and half (or whatever ratio.) It always looks bad unless the two animations are extremes of the same general motion. For example blending “big arm pump” with idle in bigger percents as you run faster.