x


Animation Layers

Hello,

I've got 9 animations on layer 1 that I manually blend between for my enemy aiming at the player, each using the enemy's waist as a mixing transform. If I CrossFade, say, a full body turn animation that's on layer 0, it cancels my aiming animations. I have to re-enable them (via .enabled = true) to get them running again but only AFTER I call .Stop on the entire animation component (I can't even just call Stop( "TurnAnimationClip" ), it has to be a full .Stop() ).

Does anyone know why my blended animations stop running? There are many animations I'll need to play, such as a weapon reload or weapon fire. I don't want every possible animation canceling the aiming.

Thanks! -Matt

more ▼

asked May 17 '12 at 10:12 PM

MOrlando gravatar image

MOrlando
46 7 8 11

Isn't that still the same problem as in your other question?

May 17 '12 at 10:59 PM Bunny83

Yea I suppose it more or less is, huh. I didn't notice your edit actually, I'll test that first thing tomorrow, Bunny. I really appreciate you sharing that script, fantastic. :)

May 17 '12 at 11:51 PM MOrlando
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Check out the script reference: Animation.Stop() will stop all animations on all layers.

If it helps, Animation.Play() and Animation.CrossFade() take an optional parameter specifying whether they should stop or fade out all animations, or just the ones on the same layer. By default, both will operate on the one layer only.

Is there some reason you're calling Stop()? If your animations are layered, it seems like something you wouldn't have to do very often.

more ▼

answered May 17 '12 at 10:32 PM

rutter gravatar image

rutter
5.2k 2 11

That's exactly my confusion, the animations on layer 1 seem to just stop when I play any animations on layer 0. The animations on layer 0 are "full body" and the blended animations are waist and up.

What happens is I play a transitional animation (like going from idle to alerted by the player). When that animation completes, I have to call .Stop() before I can play a full body "alert idle" and then the 9 blended animations.

I can't seem to get the additive animations working either (for instance, I'd like to play a 'Fire' animation that won't bring my blended aiming animations back to center before returning again). But that's another problem I suppose...

May 17 '12 at 10:46 PM MOrlando
(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:

x3774
x150
x94

asked: May 17 '12 at 10:12 PM

Seen: 1472 times

Last Updated: May 18 '12 at 03:18 PM