Search Unity

Animation needs to be marked as Legacy?

Discussion in 'Editor & General Support' started by jmane2012, Nov 6, 2012.

  1. jmane2012

    jmane2012

    Joined:
    Apr 17, 2012
    Posts:
    69
    I am currently using Unity 4 Pro Beta, and when trying to use an animation the Console states that any animation I try and use must be marked as Legacy. That wouldn't be a problem if I were able to easily find a way to do that. Usually there's an option on the components Inspector, but not that I can see for an animation. Does anyone know how to fix this problem?
     
  2. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Animations can be set to Legacy in the Import Inspector's Animation Type in the Rig panel.
     
    Deleted User and james7132 like this.
  3. jmane2012

    jmane2012

    Joined:
    Apr 17, 2012
    Posts:
    69
    Thanks! Would have never thought to look in rigs, sorry my first time even attempting to deal with animations.
     
  4. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Hmmm, yeah, "Rig" sort of implies that it's already a humanoid or a skinned mesh which is slightly misleading/confusing.

    I wonder if it defaults to Legacy, or Generic at least, if you simply import a cube being animated for example. Will look into this tomorrow.
     
  5. jmane2012

    jmane2012

    Joined:
    Apr 17, 2012
    Posts:
    69
    It was not default set at Legacy unfortunately, but it is working like a charm now!
     
  6. Engineerius

    Engineerius

    Joined:
    Mar 25, 2013
    Posts:
    1
    oh man i couldnt found this for days! thank you!
     
  7. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    hi,

    Thanks! I could not figure it out, indeed "rig" is misleading when you want to set te animation, since there is an animation tab...

    bye,

    Jean
     
  8. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    I am receiving the same warning, but I'm not working with a model, just a cube primitive I'm trying to rotate with an AnimationClip. I'm using the "legacy" animation editor view to create a simple AnimationClip that rotates the target object. Then I'm adding an Animation component to my cube at runtime and attaching the clip to it using gameobject.animation.Addclip(). When I call AddClip(), it says the AnimationClip has to be marked as legacy and apparently won't add it. But I don't see any way to do that. It's not a setting in the AnimationClip's importer, and since it's just a stand-alone AnimationClip, there's no model importer setting to set. How does one go about using an AnimationClip created using the animation editor window?
     
    Last edited: Oct 27, 2013
  9. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,125
    Yess!!! I figured out how to make it legacy by default!!!
    Add this script to the Editor folder of your project (if you do not have an Editor folder create one)
     
  10. clunk47

    clunk47

    Joined:
    Apr 29, 2011
    Posts:
    22
  11. dmytro_miretskyi

    dmytro_miretskyi

    Joined:
    Jun 5, 2013
    Posts:
    1

    Hey guys! Just follow next.
    1. Switch the Inspector panel to a debug mode (3 stripes in a right top corner, near lock icon)
    2. Set the animation type to a "1"
    3. Switch the Inspector panel to a normal mode (how u wish).

    Enjoy. :)
     
  12. zanearn

    zanearn

    Joined:
    May 7, 2011
    Posts:
    25
    This works! Thanks Dmitry!

     
  13. m1735

    m1735

    Joined:
    Nov 28, 2013
    Posts:
    11
    Thanks Dmitry :)
     
  14. DrKucho

    DrKucho

    Joined:
    Oct 14, 2013
    Posts:
    140
    funny, t's so retarded that an animation you create in unity's animation window does not work when you select it on the animation component till you do the Dimitry's trick

    thanks D now it works for me.
     
  15. dinneenio

    dinneenio

    Joined:
    Sep 30, 2013
    Posts:
    1
    Dmitry you legend! thanks a million been stuck on this for ages!!!!!
     
  16. ugurrrrr

    ugurrrrr

    Joined:
    Feb 8, 2014
    Posts:
    1
    Dimitry,

    Thanks a lot :)
     
  17. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Hah, indeed! Thanks from here, too.

    To me what's more interesting to me is that we're changing an ID value, but we're not changing the actual data*... so what's the difference between 1, "Legacy", and whatever 2 is (presumably "Generic")?

    * Though... I guess it's possible that upon the value changing the data is converted in the back end...
     
    Last edited: Feb 28, 2014
  18. pickleleon

    pickleleon

    Joined:
    Feb 27, 2014
    Posts:
    1
    Thank you sooooo much Dmitry, i've literally been trying to figure this out for days
     
  19. Gregowich

    Gregowich

    Joined:
    May 4, 2014
    Posts:
    1
    I am getting the same "AnimationClip needs to be marked as legacy" problem, and tried all of your solutions:
    - I can't find a setting in the AnimationClip's importer,
    - I switch the Inspector panel to a debug mode - and there's no "animation type" to be altered!

    I am working in 2D Mode, and this is a sprite with 3 animation clips. (Although it's only giving that error for only one of the animation clips?!)
     
  20. Zaflis

    Zaflis

    Joined:
    May 26, 2014
    Posts:
    438
    Doubleclick the animation name to open more detailed page, where the type is shown.

    For my own case with 2D animation, i'd like to do this in code somehow. I have a C# script trigger that should work for any colliding object with a Animation component (note: not Animator). Animation clip can have any name aswell, it should only ever use the element 0, the 1 and only attached clip.

    I have code like this so far
    Code (CSharp):
    1. anim = GetComponent<Animation>();
    2. if (anim != null) {
    3.   anim.wrapMode = WrapMode.Once;
    4.   // Here something like...
    5.   anim.clip[0].animationType = 1;
    6.   // But obviously clip isn't array and i can't find clues.
    7. }
    This simply because different person is making the level and things shouldn't stop working simply if he forgets to change all 2's into 1 in debug mode...

    Edit: I keep reading that the devs want to drop support for using Animation directly, and focus just on Animator. That however requires 2 files for each animation, which in this case is just a once running triggered animations of different kind of traps falling, ceilings moving or stuff like that. No transitions or anything complicated needed. Animator is just overkill and bloat.
     
    Last edited: Aug 15, 2014
  21. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    Unity's animation is mental. What if you don't have an imported bipedal character?! I'm trying to animate sprites, and half the tutorials and advice is completely broke. I don't have a 'rig' button because I haven't imported an object! I'm just trying to blend anims created in Unity according to the official tutes and I get this complaint. And then, thanks to the community, I find I have to switch to Debug mode and change a 2 to a 1. If not for the community, Unity would be unusable half the time, I reckon. More than that. Thanks peeps!
     
  22. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    If you are using an "Animation"-component, it has to be legacy because Animation is legacy. The new one (mecanim) is called "Animator" and you should be able to use it without these hacks.
     
  23. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    Yeah, I finally worked that one out. The lack of explanation of the old system is disconcerting. I suppose the assumption is everyone follows the new model and won't hit upon the old model. When the new model doesn't (or can't be got to) work though, one ends up trying all sorts of hacks!
     
  24. Valia-Lee

    Valia-Lee

    Joined:
    Feb 1, 2015
    Posts:
    2
    Thx Dmitry!
     
  25. YatinK

    YatinK

    Joined:
    Jan 15, 2015
    Posts:
    1
    HI guyz I m trying to import a simple animation in to unity from 3ds max. I had animate a simple sphere using path constrain and baked it and deleted all everything else. My main problem is, I had imported sphere and in rig panel used legacy option. Now when i am hitting play its going somewhere else its not using my required position (i am sure its not going on 0,0,0 world position) plus its not taking my scaling values also it is using the same scale from import setting. I tried scale factor but if i tweak that its getting invisible. Very strange. tried to found solution from net but no luck :(. Please help me. Thanks.
     
  26. Fallow9

    Fallow9

    Joined:
    May 16, 2015
    Posts:
    1
    So I created an animation following a youtube video from a while back, and I got the same error (The legacy thing), and you all seem to be having success, but I cant find the Animation Type section under debug. I marked legacy, but there is nothing about an animation type. Please help! This is what it looks like:
     
  27. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    Can't see image. My problem was solved by not using the Legacy animation system. Add an
    Animation Controller but not an Animation. If you provide more details you may be able to jog my memory on what exactly was going wrong for me.
     
  28. nurpp

    nurpp

    Joined:
    Dec 20, 2015
    Posts:
    1
    For those of you who don't see 'animation type' when you go into debug mode, make sure to go into the animation itself in the project tab (for me it's in assets), not the component in the object that has the animation. Plus, I don't know if this is just me, but instead of animation type, I see an option for legacy. Check this.
     
  29. jimrota

    jimrota

    Joined:
    Dec 31, 2014
    Posts:
    15
    Once I had the Animator doing what I wanted and was saved (not sure which method I used to create it), I started seeing these errors. Now that it was a saved animation (for UI Buttons) I simply had to delete the Animation + Animator from each UI Button using it. Then added a new Animator component and selected the saved Animator. So the error just meant it got lost somewhere and needed resetting.
     
  30. allshaer

    allshaer

    Joined:
    Apr 29, 2014
    Posts:
    1
  31. Deleted User

    Deleted User

    Guest

    so awesome,so cool!
     
  32. phreakhead

    phreakhead

    Joined:
    Sep 5, 2017
    Posts:
    2
    If you don't want to mark your animations as legacy, you can use the new Playables API to play non-legacy AnimationClips:


    Code (CSharp):
    1.  
    2. private List<PlayableGraph> graphs = new List<PlayableGraph> ();
    3.  
    4. // Just call this function when you want to play an AnimationClip on a specific GameObject.
    5. // from https://docs.unity3d.com/Manual/Playables-Examples.html
    6. private PlayableGraph playAnim(AnimationClip clip, GameObject obj) {
    7.     PlayableGraph playableGraph;
    8.  
    9.     AnimationPlayableUtilities.PlayClip(obj.AddComponent<Animator>(), clip, out playableGraph);
    10.  
    11.     // save all graphs we create and destroy them at the end of our scene.
    12.     // you might need to optimize this if you make a lot of animations.
    13.     graphs.Add (playableGraph);
    14.  
    15.     return playableGraph;
    16. }
    17.  
    18. void OnDisable() {
    19.     foreach (var g in graphs) {
    20.         g.Destroy();
    21.     }
    22.     graphs.Clear ();
    23. }
    24.  
     
    Last edited: Sep 10, 2017
  33. manaladkennethpogi

    manaladkennethpogi

    Joined:
    Jul 12, 2018
    Posts:
    1
    how to set the animation to 1