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.
Thanks for any insight on this.
Thanks for it. This worthy question and given answers made my day.
Answer by GuyFawkes
Sep 10, 2011 at 04:01 AM
I actually asked the same question a while back, so all of the information I'm posting here is from that question (http://answers.unity3d.com/questions/160848/how-do-i-run-two-animations-at-once-on-the-same-ga.html)
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;
I just wanted to add again, all credit goes here.
Thanks that you guys have been a great help!
No problem. Did the script work for you?
Yes it did, with a little tweaking, thanks!
Do you know how to do the same using Animator component?
Answer by PrimeDerektive
Sep 10, 2011 at 03:13 AM
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
Answer by Max_power1965
Jun 29, 2016 at 08:06 PM
Hi guys. Here a very step by step tutorial that explain how to play two animations at once: http://gamedevelopertips.com/unity-run-2-animations/
Answer by DaveA
Sep 10, 2011 at 03:11 AM
Yes, why not?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
8 People are following this question.
Can I make animations snap to a frame?
Can I apply legacy animation layer on only part of character body?
Animated character from Maya to Unity problem
Using Locomotion with different avatars
2 Animations At once