- Home /
Play Two Animations Simultaneously using Animator
Basically I want to play two animation simultaneously but I can't able to find any way for it using Animation Controller.
At present I have working animation in sequence but not playing parallel. If you have any other way of playing animation in other way rather than using animation controller then please guide for it also.
So please give some information regarding this.
Answer by siddharth3322 · Jul 05, 2014 at 03:59 PM
Now I have work out my problem and find solution for it and here I post it to help other members. First I want to say that this solution it totally based on my knowledge but now it is working properly.
For playing two animation, you have to create two layers for you same game object for which you want to apply animation. Here for example, my first layer contains animation for sprite animation and in second layer contains rotation animation.
In first layer you have to create animation normally as you normally create for second animation you have to create another animation state here, not attached with any other state. My this point stated in following image.
Now you have to add other layer with weight of 1 and named it as you like.
Next you have to work for second layer, I have named it Death layer. For this you have to create empty state named Idle and create transition for your rotation animation. Here based on game over flag I am playing Death animation. Following image represent content of my second layer.
To play actual animation you have to write following code
fishAnimator.SetBool("IsGameOver",true);
If you want any other help in this subject then ask me any time.
Hi just wondering if you had figured out how to play more than 2 or more animations based on layer masks, e.g left hand wave, right hand wave and running. all 3 different animations.
Thank you this worked for me. $$anonymous$$y gameobject did not have any skinning or bones, it was straight keyframe animations, and it worked for me too. $$anonymous$$aking another layer was the answer.
Just posting my experience here as well: I also created two layers, and ran into the problem that layering with the blending would only play one animation in its fullest. I needed to check additive in the layer's properties, in addition to setting the weight to 1 for both layers.
Answer by marcozakaria · Dec 09, 2019 at 01:32 PM
Use Animation layers in animator, and put each animation in a different layer, and dont forget to configure each layer weight.
Ty was struggling on this basic , no need script in fact.
If you import let say a fbx from blender with 1 empty and several childs objects in hierarchy and each of this objects have a distinct animation and you want all actions to be played simultaneously.
Empty - Child object 1 animation 1 - Child object 2 animation 2 - Child object 3 animation 3 etc..
Import fbx to unity
Create animator controller (right click -"create") - double click on it to open the animator window.
Drag animation 1 from the imported fbx bundle in the animator window.
Create a layer (+ sign , top left of animator window)
Drag animation 2 in the new layer window - set layer weight to 1 (* sign next to layer under the +sign columns
Create a layer
Drag animation 3 in the new layer window- set layer weight to 1
Last : drag your empty in the scene, and drag the controller on your empty - Check the "always animate" box in the inspector panel
Play
Your answer
Follow this Question
Related Questions
Unity 2d animation acting strange 0 Answers
How can I animate 2d sprite rotation without interpolation? 4 Answers
A node in a childnode? 1 Answer
How should I set up 2D animations for weapons in Unity? 0 Answers
Custom Pivot Points in Sprite Editor 1 Answer