Search Unity

Confused about Legacy and Mecanim modules

Discussion in 'Animation' started by DannyB, Oct 27, 2013.

  1. DannyB

    DannyB

    Joined:
    Jun 20, 2012
    Posts:
    214
    Hey everybody,

    Up until now I haven't used any Unity animation mechanisms, I only animated things by code (doing 2D games).
    I am trying to understand now which of the Unity animation related panes are Legacy and which are Mecanim.

    I do not want to animate humanoids - my animation needs vary between 2D characters, and animated menus and cut scenes.

    Should I use Mecanim for that?

    Also - is my understanding correct that the "Window > Animation" menu item is the legacy system, and "Window > Animator" is mecanim?

    I am currently under the assumption that this is the guide I should follow, and I should avoid the "Animation" window.


    EDIT:
    I thought that the Mecanim "Generic Animations" concept is what I need for non humanoid animations, but the manual page about it starts by telling me how to configure the FBX Importer... in my case, I am not using any external models - I just want to move some objects around... what am I missing?
     
    Last edited: Oct 27, 2013
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    Pretty much, if you're not animating models that have bones, then Mecanim is not for you.

    You would set up motions using the Animation window, or look in the Asset Store for some of the "tweening" helper modules (iTween, etc.). Some are visually oriented and some are scripting oriented. Google around for tweening and animating primitive shapes in Unity.
     
  3. DannyB

    DannyB

    Joined:
    Jun 20, 2012
    Posts:
    214
    Yeah, well I am using iTween, but I figured I should try to use Unity's built in tools.

    If Mecanim is not (yet) for animating non-humanoids, then I don't understand why do they call the other animation system "Legacy".
    "Legacy" is something that has a new version replacing it... and as it seems, Mecanim does not provide a good replacement for it yet.

    Also adding to the confusion - I saw some videos about Unity 4.3, where they use curve based animation editor that looks pretty much like the current one (not Mecanim) to edit 2D animations. So, is the curve animation editor legacy or not? If it is, what is the alternative?
     
  4. Pirs01

    Pirs01

    Joined:
    Sep 30, 2012
    Posts:
    389
    Mecanim "Generic Animations" is for non-humanoid animations in Mecanim. What halley said is that you can't use Mecanim if your model doesn't have bones.
     
  5. DannyB

    DannyB

    Joined:
    Jun 20, 2012
    Posts:
    214
    Ok, correction - I meant "non model".
    I do not import any external model, but using 2D (with 2D Toolkit) - can the generic animation in mecanim workflow be done without an external model?
    The generic animation guide immediately starts with "Change the FBX Import settings....".

    Imagine I want to move and scale a cube and a sphere.
     
  6. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    Mecanim "Generic" would handle dragons, snakes, industrial robots, and other non-humanoid models that you design with bones and bone animations, and import (such as via FBX format).

    "Legacy" would handle the old way of animating such models with bones and bone animations.

    The rest is up to you manipulating the transforms of your primitive objects (menu boards, tree limbs, trapdoors, etc.) in the most appropriate way for those objects. Since there are so many different kinds of things that move like this, there are many approaches. It can all be done via scripting or (sometimes) clever use of physics joint calculations, so the base Unity package has only the minimum primitive tools for working with them. That's why there are so many packages on the Unity Asset Store, where people have written up clever utilities like iTween to take some of the grunt work out of common cases like "wiggle around randomly for 2 seconds."
     
  7. DannyB

    DannyB

    Joined:
    Jun 20, 2012
    Posts:
    214
    This page says that Animation View is considered legacy.
    Using this Animation View, you can freely animate any feature of any game object, without bones or muscles or FBX import.
    What is the "non legacy" way of doing it? (besides using code of course)
     
  8. Pirs01

    Pirs01

    Joined:
    Sep 30, 2012
    Posts:
    389
    Mecanim. which came after legacy. Thing about Mecanim is that it has all this intelligent stuff like built in state machine to blend animations based on parameters and that kind of stuff. Legacy is more low level I suppose. I'm new to this so don't take what I say too seriously.

    EDIT: Animation is Legacy. Animator is the state machine I mentioned for Mecanim.

    EDIT: You can have an animation clip without model though you have to import it with one I guess. Check this post out:
    http://forum.unity3d.com/threads/206650-MotionBuilder-to-Unity-What-export-for-animations-only
    I don't know how the 2d kit works so no idea if it will work with Mecanim or Legacy. It should I suppose as long as the 2d is actually a 3d scene with orthographic camera and stuff happening in only 2 dimensions.
     
    Last edited: Oct 27, 2013
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    DannyB, you're right. If you're animating properties other than bones (such as transforms), you need to use Legacy, which lets you add an animation curve to any property (position, scale, rotation, color, opacity, etc). Legacy still exists because Mecanim doesn't yet do everything that Legacy does.

    Alternatively, you could use a free Unity package like Orthello for 2D animation, or any of the paid packages, some of which are very good and will save you a lot of time.
     
  10. DannyB

    DannyB

    Joined:
    Jun 20, 2012
    Posts:
    214
    Thanks Tony - good to know I did not get it wrong. Of course, I know there are various ways to animate stuff, but I wanted to try out one of the Unity built in tools for it. Its just my luck that when I want to try it, it goes "legacy"... :)

    So the simple truth is this: Transform / Curve based animations in Unity is currently only supported as a part of a deprecated (Legacy) system.

    I wonder why Unity took this course of action. I mean, even videos of Unity 4.3 show this exact "Legacy" editor - meaning, even in 4.3 there is no substitute to this editor, and still it is labeled "Legacy". Guess we will have to wait and see.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    At this point, Legacy isn't deprecated so much as not in active development. It's still supported. They're just not going to add new features to it. Unity is pouring all their efforts into Mecanim. But I suspect Legacy will be around for a few years at least until Mecanim subsumes all of its functionality..
     
  12. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    This is a bit confused, Manual recommends not to use Legacy, but Mecanim seems too much for simple UI animations..