Playing two animations simultaneously

Hi.
I’m created car model in 3DS max, and animated door open-close process. Animations for all 4 doors placed in one timeline.
After importing fbx into Unity3d, I’m splitted animation to 4 parts:

  • “frontLeft”
  • “frontRight”
  • “backLeft”
  • “backRight”.

I tried to play 2 animations simultaneously:

void Update() {    
    ...
    animation.Play("frontLeft");
    animation.Play("frontRight");
    ...    
}

-but, in this case, first animation immediately stops, and then plays second invoked animation.

How I can solve this problem?

1 Answer

1

animation.CrossFade(“frontLeft”);
etc

http://docs.unity3d.com/Documentation/ScriptReference/Animation.html

you can also change the Blend mode to additive:

animation[“frontLeft”].blendMode = AnimationBlendMode.Additive;

for each one (I think, always get that confused though, it’s Additive or Blend…)

I think you should also set them to separate layers:

animation[“frontLeft”].layer = 1;

etc…

and make sure they are all PlayMode.StopSameLayer

animation[“frontLeft”].playMode = PlayMode.StopSameLayer;

some of those are probably already defaulted to those settings, but I don’t recall which…

all this is probably not necessary, but I know the answer is in there somewhere...

–