- Home /
Animation Must be marked as legacy
I've seen responses to this question for meshes, but I'm asking this question in regards to 2D sprites that are nested.
I have three sprites that I have animated using the animation editor in Unity3D for a 2D game. When I try to play the animation, Unity gives me a warning:
The AnimationClip 'Punch2Carl' used by the Animation component 'Carl_0013_ArmBak1' must be marked as Legacy. UnityEngine.Animation:AddClip(AnimationClip, String)
I am not using a mesh, so I cannot mark the animation as legacy in the inspector. I've tried finding a legacy property for the animation, but I haven't seen it in the properties.
Afterwards, the animation will not play. The animation does play in the animation editor fine.
The setup of the game objects that are all animated (nested): - Sprite - - Sprite - - - Sprite
Any ideas?
$$anonymous$$ine is still greyed out....I cannot copy it, and I am having a lot of trouble co$$anonymous$$g to grips with this...scripting it would be easier for me, but I just want to do a few idle animations for object and keep things as simple as possible. This is more of a "your answer did not work for me" than an actual answer...and I don't want to keep opening up new questions for the same issue.
Answer by Key_Less · Nov 18, 2013 at 05:38 PM
I've recently ran into this exact same problem and I've found 2 ways to solve my issue, so I'm hoping I can help you.
EDIT---------------------------------------------------------------------------------
This post is becoming aged but keeps popping up so I'll add an edit. Since the original post I've been made aware of an easier way to mark your animation files as Legacy:
If you select your animation in the Project window, then go to the top right corner of the Inspector window and select Debug from the drop down menu (next to the lock), then change the Animation Type to 1 will mark it as Legacy.
-------------------------------------------------------------------------------------
I'm not sure if you did, but when I created my original animation files, I did so inside of the "Project" window. Try adding an animation component to the sprite you want to animate, then open the animation window and select "[create new animation]" in the drop down menu. Doing it this way seems to create the new animation with the legacy animation flag set. This way you can completely avoid the warning or need for editing animation files.
I hope this solves your issue, I know how frustrating it was for me.
1) Ah! This fixed it! Thanks for the tip! I've modified the asset files before, so I should have thought of this, but I'd been wrangling with this issue for hours that I was quite disgusted with the problem. Thanks!
2) This is how I made the animation, aside from doing it in the project as I used the hierarchy to make the animation on a game object in the scene. I'll try this method in the future.
I cant change the animation type to 1 because it is greyed out. Its current setting is 2. How would I get it to where I can make the edits.
@derekwsparks, I had the same problem you did. When you look at the setting in the inspector it has all the options greyed out so you can't change anything. Whatever is the "master parent" (how it lists in the Hierarchy panel) for your model, go to that in the Project panel. In the Inspector panel, you should be able to change the settings in either "normal" or "debug" view, under the Rig tab, you will see Animation Type, and change that to Legacy. I'm not sure but I think the reason you have to change settings in the master parent, is all the children were imported into Unity as children, and should be modified through it's parent. I didn't make Unity so it's just a guess. Hope this fixes your problem.
If it's greyed out...then 'd' duplicate the animation. Then change new ones to '1'.
Answer by catiegee4 · Jan 28, 2016 at 01:27 PM
Is anyone else being told that legacy clips cannot be in Animation Controllers? The compiler error says to mark the clip as legacy, and then the next error says that legacy clips cannot be in Animation Controllers.
Hi redu4ia,
I'm using Unity 5.3.2f1, and I experience a problem similar to yours, because my project involves 2D sprite sheets. When I mark an animation clip as legacy in the debug inspector, I next receive a warning, "The legacy Animation Clip 'animation' cannot be used in the State 'animState'. Legacy AnimationClips are not allowed in Animator Controllers." The work-around I'm experimenting with involves not marking my animations as legacy, then in my animator controller assigning them to my animation states but not making any transitions except for the Entry. I then write my own animation script, using this as a reference: http://docs.unity3d.com/$$anonymous$$anual/AnimationScripting.html . Unfortunately, that means co$$anonymous$$g up with your own state machine in a code with an uncertain future.
using UnityEngine;
public class Anim : $$anonymous$$onoBehaviour {
public Animator animator;
public float transitionDuration = 0.0f;
private int idle = 0;
public int durationToChange = 0;
public int durationThreshold = 200;
public string idleString = "Idle0";
void Awake() {
if(animator == null) animator = this.gameObject.GetComponent<Animator>();
}
void OnEnable() {
animator.Play("Idle0");
}
void Update() {
if(Player.S.isGrounded) {
if (Actions.S.forward > 0 || Actions.S.backward < 0) {
if (Actions.S.run > 0) {
animator.CrossFade("Run", transitionDuration);
} else {
animator.CrossFade("Walk", transitionDuration);
}
} else {
animator.CrossFade(idleString, transitionDuration);
}
} else {
animator.CrossFade("Jump", transitionDuration);
}
durationToChange++;
if(durationToChange >= durationThreshold) {
idleString = chooseIdle();
durationToChange = 0;
}
}
string chooseIdle() {
idle = (idle + 1) % 3;
return "Idle" + idle;
}
}
I had the same problem. I had an Animation and an Animator component on my Game Object. It seems that's not allowed. The Animation component even was deactivated, that's why I paid no attention to it. Removing the Animation component solved the issue.
@poppers73 for me i require an Animation component
Answer by deuxieme · Sep 19, 2015 at 03:30 AM
Just throwing this out there, but I ran into this problem and although I set the Animation to 'Legacy', it would not recognize this. A simple re-launch of Unity fixed it. Try it, who knows!
Answer by LymanCao · Jul 08, 2016 at 02:20 PM
I've found an easy way to resolve this problem. 1. Open .anim file with an text editor. 2. find string "m_Legacy: 0" 3. change to "m_Legacy: 1" 4. save the file. 5. Done
Answer by yuriki · Jul 11, 2018 at 09:05 PM
I fought with this error all day long! Nothing above didn't help me (because my animation was not inside .anim-file but inside .fbx-file) What helped me is this:
1) Delete Animation component
2) Add Animator component
3) Inside Animation tab (don't mix up with Animation component) hit Create button and save Dance.anim file (or use other name).
4) Inside Animator tab select node Dance (name as above) and in Inspector choose your clip from FBX-file for Motion field.
That's all!
Hi yuriki, I would like some help, I think I have the same problema as you. Can you help me
I don't now how to explain but Its some how related with "Animation" component added to the script