# unity animation not starting

I have written the following code:

public class TargetAnimation : MonoBehaviour {
Animation anim;
public AnimationClip Open;
// Use this for initialization
void Start () {
anim = GetComponent<Animation>();
anim.Play ("Open");

}
}


I have the following script and animation settings:

I have put the animation type in legacy and the generation as store in root (Depricated) as suggested elsewhere, this did not work. The animation works in the import/annimations view. The origenal comes from blender. And all f this is in unity 5.

• the animation needs to be not in legacy (1) but in (2) as per being played. That's what I ofund out yesterday. – Leggy7 Apr 30 '15 at 11:25
• How do I do that? – Thijser Apr 30 '15 at 11:27
• when you select the animation and look the inspector, put it in debug mode (the little icon top right of the inspector) and in type write "2" without quotes – Leggy7 Apr 30 '15 at 11:33
• I cannot seem to find it maybe you could answer with a screenshot (that way I can also upvote/accept if it works)? – Thijser Apr 30 '15 at 11:42
• I have not unity right now. I posted an answer with a link to what solved my issue :) – Leggy7 Apr 30 '15 at 12:00