x


Before updating to Windows 10 you may need to return your Pro license. More information here

Way to play two animations at once?

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.

more ▼

asked Sep 10, 2011 at 03:06 AM

avatar image

uberdood12
46 20 18 20

Thanks for it. This worthy question and given answers made my day.

Cheers

Mar 30 at 01:16 PM saud_ahmed020
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

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.

more ▼

answered Sep 10, 2011 at 04:01 AM

avatar image

GuyFawkes
121 49 43 44

Thanks that you guys have been a great help!

Sep 10, 2011 at 11:36 AM uberdood12

No problem. Did the script work for you?

Sep 10, 2011 at 01:12 PM GuyFawkes

Yes it did, with a little tweaking, thanks!

Sep 10, 2011 at 08:10 PM uberdood12
(comments are locked)
10|3000 characters needed characters left

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

function Start(){ animation["shoot"].AddMixingTransform(torsoBone); }

more ▼

answered Sep 10, 2011 at 03:13 AM

avatar image

PrimeDerektive
3.6k 168 139 191

(comments are locked)
10|3000 characters needed characters left

Yes, why not?

more ▼

answered Sep 10, 2011 at 03:11 AM

avatar image

DaveA
34.7k 420 360 561

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x8209
x82
x45
x21

asked: Sep 10, 2011 at 03:06 AM

Seen: 8839 times

Last Updated: Mar 30 at 01:16 PM