- Home /
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?
Answer by Seth-Bergman · Aug 06, 2012 at 02:14 PM
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...
Your answer
Follow this Question
Related Questions
Move cube forward 0 Answers
Animation From blender to Unity Animator - Import Error 1 Answer
Multiple FBX Animations 1 Answer
Export Maya Animations to Unity But It Shows Nothing 0 Answers
Can the animation editor create local rotational data? 3 Answers