Animation Error Help?

I have an animation that I want to play on a sword in my game but I keep getting these two errors:

The AnimationClip ‘sword’ used by the Animation component ‘Sword’ must be marked as Legacy.

Default clip could not be found in attached animations list.

also this is my Javascript code:

#pragma strict

function Update () {

if (Input.GetButtonDown("Fire1"))
    animation.Play("sword") ;

}

Update: This is also happening with other animations that are not attached to a script.

1 Answer

1

you are using the old animation system of unity so in import settings of your animation you should
set it as legacy animation , and you should add an animation component to your game object and add your animation to the animation array

How do i do this? I'm new to unity and VERY new to animation. I've got the animation component. I just dont know what all the other stuff you were talking about is

to set legacy on import setting read [this][1] [1]: http://docs.unity3d.com/Manual/Animations.html

to add animation simply cick your animation component and add animations to the array that is right there it should look like [this][1] [1]: http://docs.unity3d.com/Manual/class-Animation.html

I dont see anything like the legacy bit. Im making the animation using the animation tab. Yeah but i never see these import settings

Never mind i figured it ou. Thanks for you help :)