Quick answer: The object has an Animation component, which belongs to Unity’s legacy animation system, and the clip assigned to it was made for the Animator. A clip works with one system or the other. Either replace the Animation component with an Animator and an Animator Controller, which is the right choice for most projects, or mark the clip as Legacy: on an imported model set Rig > Animation Type to Legacy, on a .anim asset switch the Inspector to Debug mode and tick Legacy, and on a clip built in code set clip.legacy = true.
You press Play, the object does not move, and the Console says a clip “must be marked as Legacy”. Nothing is wrong with the clip. Unity has two animation systems with nearly identical component names, and the clip and the component on your object come from different ones. This guide explains the two systems, shows both ways out with exact steps, covers the mirror-image message you get when a legacy clip is put into an Animator Controller, and says when the legacy component is still a reasonable thing to use.
- The exact error
- Two animation systems, one clip type each
- How a project ends up with the mismatch
- Fix A: use an Animator and a controller
- Fix B: mark the clip as Legacy
- The reverse message: a legacy clip in an Animator Controller
- Why clips from the Animation window come out differently
- When the legacy component is still a fair choice
- How to confirm the fix
- What reaches Bugnet from a shipped build
- Related guides
- Frequently asked questions
The exact error
The AnimationClip 'Walk' used by the Animation component 'Player' must be marked as Legacy.
The first name is the clip and the second is the GameObject. Two more messages often arrive with it. When the rejected clip was the component’s default:
Default clip could not be found in attached animations list.
And when a script then asks for the clip by name:
The animation state Walk could not be played because it couldn't be found!
Please attach an animation clip with the name 'Walk' or call this function only for existing animations.
The mirror image appears when a legacy clip is used in an Animator Controller:
The legacy Animation Clip "Walk" cannot be used in the State "Walk". Legacy AnimationClips are not allowed in Animator Controllers.
All four are Console messages, not exceptions. No script stops, the game keeps running, and the only visible symptom is an object that stays in its starting pose.
Two animation systems, one clip type each
Every AnimationClip carries a hidden Legacy flag. The flag decides which component can play it.
| Animation component | Animator component | |
|---|---|---|
| System | Legacy animation | Mecanim |
| Clip it accepts | Legacy flag on | Legacy flag off (the default) |
| Where clips are listed | The Animations list on the component | States in an Animator Controller asset |
| Play from a script | GetComponent<Animation>().Play("Walk") | animator.Play("Walk"), or parameters such as animator.SetBool("IsWalking", true) |
| Blending | CrossFade and Blend calls from code | Transitions, blend trees and layers set up in the controller |
| Humanoid retargeting | No | Yes |
| Model import setting | Animation Type: Legacy | Animation Type: Generic or Humanoid |
| Looping is set by | Wrap Mode | Loop Time on the clip |
Unity’s manual describes the Animation component as retained for backwards compatibility and says to use the Animator for new projects. The legacy component still works in Unity 2022 LTS and Unity 6.
How a project ends up with the mismatch
- The wrong component was added. Animation and Animator sit next to each other in the Add Component search results and differ by two letters.
- An old tutorial or script. Code that calls
GetComponent<Animation>()or uses[RequireComponent(typeof(Animation))]puts the legacy component on the object, and the clips you then make in a current Unity version are not legacy. - A clip from an imported model. A model whose Rig tab is set to Generic or Humanoid produces non-legacy clips. Dragging one into an Animation component gives this message.
- A clip created in the Project window. A clip made from the Project window’s Create menu is not legacy.
- A clip created in code.
new AnimationClip()is not legacy until you set the flag, soAddClipon an Animation component rejects it. - The reverse: old assets in a new setup. An older asset pack whose models were imported as Legacy, dragged into an Animator Controller, gives the “Legacy AnimationClips are not allowed in Animator Controllers” message.
Fix A: use an Animator and a controller
This is the fix for characters, for anything that needs to blend between clips, and for any new project. The clip stays as it is and the component changes.
- Select the object. On the Animation component, open the component’s menu and choose Remove Component.
- Drag the clip from the Project window onto the object in the Hierarchy. Unity creates an Animator Controller asset beside the clip with the clip as its default state, adds an Animator component to the object and assigns the controller to it.
- For more clips, open Window > Animation > Animator with the object selected and drag the other clips into the grid. Each becomes a state named after its clip.
- Select each clip and set Loop Time as needed. It replaces the legacy Wrap Mode.
If you prefer to do step 2 by hand, add an Animator component, create an Animator Controller asset from the Project window’s Create menu, assign it to the Animator’s Controller field and drag the clip into the Animator window.
Then update the script. The method names are similar, but they belong to different classes:
// Before: legacy component
Animation anim = GetComponent<Animation>();
anim.Play("Walk");
anim.CrossFade("Run", 0.2f);
// After: Animator
Animator animator = GetComponent<Animator>();
animator.Play("Walk"); // jump to the state named Walk
animator.CrossFadeInFixedTime("Run", 0.2f); // blend to Run over 0.2 seconds
The string is the name of the state in the controller, which starts out equal to the clip name. Playing states by name is the closest match to the legacy style. The more common Animator pattern is to add parameters and transitions in the controller and set them from code with SetBool, SetFloat and SetTrigger. When a transition then refuses to fire, How to Fix a Unity Animator Transition That Won’t Fire lists the reasons.
Fix B: mark the clip as Legacy
Choose this when you want to keep the Animation component. Where the flag lives depends on where the clip came from.
A clip inside an imported model
- Select the model file (the
.fbx, not the clip inside it) in the Project window. - In the Inspector, open the Rig tab.
- Set Animation Type to Legacy and click Apply.
This changes every clip in that file. If an Animator Controller elsewhere uses those clips, it will now show the opposite message, so do not switch a model that both systems share. A clip imported with a Humanoid rig stores its motion in a form that only an Animator with an Avatar can play, so for a humanoid character use Fix A.
A standalone .anim asset
- Select the clip in the Project window.
- Open the menu at the top right of the Inspector (the three dots) and choose Debug.
- Tick Legacy.
- Switch the Inspector back to Normal.
The checkbox only appears in Debug mode. A clip that lives inside a model file is read-only and its checkbox is greyed out. Either change the model’s Rig tab as above, or select the clip, duplicate it with Ctrl+D (Cmd+D on macOS) to get an editable .anim copy, and tick Legacy on the copy.
A clip created in code
using UnityEngine;
public class SlideIn : MonoBehaviour
{
void Start()
{
AnimationClip clip = new AnimationClip();
clip.legacy = true; // without this line, AddClip logs the error
AnimationCurve curve = AnimationCurve.EaseInOut(0f, -5f, 1f, 0f);
clip.SetCurve("", typeof(Transform), "localPosition.x", curve);
Animation anim = gameObject.AddComponent<Animation>();
anim.AddClip(clip, "SlideIn");
anim.Play("SlideIn");
}
}
Set legacy before the clip is handed to the component. For clips that arrive from somewhere else, such as an asset bundle or a designer-assigned field, check the flag and say what is wrong in your own words:
if (!openClip.legacy)
{
Debug.LogError($"{name}: clip '{openClip.name}' is not marked Legacy, so the Animation component cannot play it", this);
return;
}
anim.AddClip(openClip, "Open");
The reverse message: a legacy clip in an Animator Controller
“Legacy AnimationClips are not allowed in Animator Controllers” is the same mismatch from the other side, and the same three places hold the flag:
- Imported model: on the Rig tab, change Animation Type from Legacy to Generic, or to Humanoid for a two-legged character you want to retarget, and click Apply.
- Standalone clip: switch the Inspector to Debug and untick Legacy.
- Clip made in code: remove
clip.legacy = true.
After changing a model’s Animation Type, the Animator needs an Avatar that matches the new rig. How to Fix a Unity Model Rig Set to Generic When You Need Humanoid covers that step.
Why clips from the Animation window come out differently
The Animation window (Window > Animation > Animation) decides the clip type from the components on the selected object at the moment you click Create:
| The selected object has | What Create does |
|---|---|
| No animation component | Creates a non-legacy clip and an Animator Controller with the clip as its default state, adds an Animator and assigns the controller |
| An Animator | Creates a non-legacy clip for the Animator’s controller |
| An Animation component | Creates a legacy clip for that component |
This is how two clips made minutes apart in the same project end up incompatible. It also gives you a way to make a legacy clip without Debug mode: add the Animation component first, then create the clip from the Animation window. A clip made that way cannot go into an Animator Controller later without unticking Legacy.
When the legacy component is still a fair choice
The Animator is built for state: which clip plays now, what it blends into, and under what conditions. Some animation has no state. A door that plays one clip when opened, a pickup that bobs forever, a panel that slides in once. For those, the Animation component means one component, one clip and one Play() call, with no controller asset to create and keep in sync. Clips generated at runtime with SetCurve, as in the example above, are another reasonable use.
Use the Animator when the object has more than a couple of clips, when clips need to blend based on gameplay values, for any humanoid character, and for anything driven by Timeline, whose Animation tracks bind to an Animator. Mixing is fine across objects: one prop can use the Animation component while your characters use Animators. What does not work is one clip shared by both systems.
How to confirm the fix
Clear the Console and enter Play mode. None of the four messages should appear, and the object should move. Trigger every clip on the object, including the ones that are not the default, because the check is made per clip. If you changed a model’s Rig tab, open each scene and prefab that uses that model and look for the reverse message. Then make a build and test the same objects there. In a player there is no Console on screen, so the symptom is a still object and a line in Player.log.
What reaches Bugnet from a shipped build
This is a setup error that you normally catch in the editor, because it appears the first time the object is used. The cases that escape are the ones on a path you did not play: a prop in a late level, a clip assigned to one prefab variant, a clip loaded from an asset bundle. The Bugnet Unity SDK files what Unity logs with the type Error, Exception or Assert, and it skips warnings. Look at the icon beside the message in your Console. If it is yellow in your Unity version, nothing is filed automatically for it.
The guard in Fix B removes the doubt. A Debug.LogError that names the object and the clip is filed with recent log lines, game version, platform and OS, and identical titles stack into one entry with an occurrence count. Without a logged error, what you get is a player’s own report from the in-game form (“the gate never opens”) with their device details attached. Bugnet cannot inspect the clip or tell you which flag is set. That check happens in the editor. The bug reports guide shows what each report contains.
Related guides
- How to Fix a Unity Animator Transition That Won’t Fire
- How to Fix the Unity “Parameter does not exist” Animator Warning
- How to Fix a Unity Animation Not Looping
- How to Fix a Unity Model Rig Set to Generic When You Need Humanoid
- 12 Common Unity Errors and How to Fix Them
Frequently asked questions
What does “must be marked as Legacy” mean in Unity?
The object has an Animation component, which is part of Unity’s legacy animation system, and the clip assigned to it was created for the Animator. Each clip has a Legacy flag and works with only one of the two systems. Change the component to an Animator or turn the flag on for the clip.
How do I mark an AnimationClip as Legacy?
For a clip inside an imported model, select the model, open the Rig tab, set Animation Type to Legacy and click Apply. For a standalone .anim asset, switch the Inspector to Debug mode from its three-dot menu and tick Legacy. For a clip created in a script, set clip.legacy to true before adding it to the Animation component.
What is the difference between the Animation and Animator components?
Animation is the legacy component: it holds a list of clips and plays them by name from code. Animator plays clips through an Animator Controller asset with states, transitions, parameters and blend trees, and it supports humanoid retargeting. Unity recommends the Animator for new projects.
How do I fix “Legacy AnimationClips are not allowed in Animator Controllers”?
The clip has its Legacy flag on and you placed it in an Animator Controller. Turn the flag off: set the model’s Rig tab Animation Type to Generic or Humanoid, or untick Legacy on the clip in the Inspector’s Debug mode. Clips that are part of a model file can only be changed through the Rig tab.
Why can’t I see the Legacy checkbox on my animation clip?
The checkbox is only shown when the Inspector is in Debug mode, which you select from the menu at the top right of the Inspector. If the clip is inside an imported model the checkbox is greyed out. Change the model’s Rig tab, or duplicate the clip to get an editable copy.
A clip belongs to one animation system. Decide whether the object should use an Animator or the legacy Animation component, then make the clip’s Legacy flag match.