Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Multiple animations in the same state

Discussion in 'Animation' started by Jymmy097, Aug 6, 2017.

  1. Jymmy097

    Jymmy097

    Joined:
    Jul 7, 2014
    Posts:
    67
    Hi everybody,

    I exported an animated steam locomotive model from Blender to Unity.
    Apart from the fact that, when I imported the fbx to Unity there were a lot of garbage animations (and I do not know why), I need some help to play all the animations together.
    In the side of the wheels of the locomotive there are some rods: I've animated all of them and produced 8 different animation clips: one for each rod.

    Now, the locomotive has an animator component that has two states: Stopped and Moving. I'd like to play all my animation clips at once when I reach the Moving state. I tried, but I can only play one single animation clip inside a state.

    Could somebody please help me?

    Thank you very much for your patience and for your time.
     
  2. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    I'm in the same boat right now. What I did was make layers and set them to additive. But I really would recommend in your case that you animate them all together and make one clip.
     
    ejzh57 likes this.
  3. IsaiahKelly

    IsaiahKelly

    Joined:
    Nov 11, 2012
    Posts:
    418
    For optimal performance you should always bake multiple animated elements on the same model into a single animation clip when exporting. However, you can easily play multiple animations at the same time with a blend tree.
    1. Create an empty state in the Animator.
    2. Right click on empty state and select "Create new BlendTree in state"
    3. Double click on state to open new BlendTree then select the BlendTree itself.
    4. Add each animation you want to play as a motion on the BlendTree.
    5. Uncheck "Automate Thresholds" and set all thresholds to 1.
     
    dedemonn, Adarsh_V, JFLGD and 8 others like this.