playing animations

I’m having problems playing animations with a script. I have the animation I’m trying to play under the prefab in the project, but when I play the scene I get the errors

“The AnimationClip ’ walk’ used by the Animation Component ‘character’ must be marked as Legacy.” and

“Default clip could not be found in attached animations list.”
And when I try to run the script I get the error

“MissingComponentException: There is no ‘Animation’ attached to the “Avatar” game object, but a script is trying to access it. You probably need to add a Animation to the game object “Avatar”. Or your script needs to check if the component is attached before using it.”
appearing every frame. I don’t understand what I’m doing wrong.

Change your models import settings to Legacy under the animation ‘Rig’ tab and make sure you animation component has the animation clips. The error log tells you exactly what to do.