- Home /
Play 2 animations at once
Hi all, i saw much answers about:
animation.Play("walk"); animation["wave"].layer=1; animation.Play("wave"); animation["wave"].weight=0.4f;
but then as example if i will play the attack animations. It don't seems good because the weight is less then 1. Is there a solution for playing 2 animations 100% or something? Thanks.
Answer by Kiwasi · Oct 10, 2014 at 10:13 AM
Set the weight of both to 1...
Answer by Cherno · Oct 10, 2014 at 10:16 AM
What exactly are you trying to do? If you want to play the attack animation while also playing the running animation, you basically let the whole model play the running animation, but then everything branching out from the torso bone plays a different animation (attack).
AddMixingTransform and Layers are what you will have to become familiar with. As usual, Unity API is your friend :)
The attack animations only uses the arms, and running are the legs. So just 2 animations who aren't disturbing each other with same bones
As I said, check the Unity API for Add$$anonymous$$ixingTransform, it should have examples that can be applied to your casee.
Answer by Max_power1965 · Jun 05, 2016 at 05:22 PM
You can play two animations at the same time by using the unity animator system: Here a useful step by step guide: http://gamedevelopertips.com/unity-run-2-animations/
Answer by ericbegue · Jun 05, 2016 at 06:47 PM
You would need to set up a mask such that the "wave" animation influences only the arm ( or body parts you want to be animated by the "wave" animation) and not the rest of the body. The other parts will be animated by "walk" animation.