- Home /
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
Isn't that still the same problem as in your other question?
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. :)
Answer by rutter · May 17, 2012 at 10:32 PM
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.
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 ai$$anonymous$$g animations back to center before returning again). But that's another problem I suppose...