2
\$\begingroup\$

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.AddClip (Open, "Open");
        anim.Play ("Open");

    }
}

I have the following script and animation settings: image showing exactly what might possibly be wrong

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.

\$\endgroup\$
  • \$\begingroup\$ the animation needs to be not in legacy (1) but in (2) as per being played. That's what I ofund out yesterday. \$\endgroup\$ – Leggy7 Apr 30 '15 at 11:25
  • \$\begingroup\$ How do I do that? \$\endgroup\$ – Thijser Apr 30 '15 at 11:27
  • \$\begingroup\$ 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 \$\endgroup\$ – Leggy7 Apr 30 '15 at 11:33
  • \$\begingroup\$ I cannot seem to find it maybe you could answer with a screenshot (that way I can also upvote/accept if it works)? \$\endgroup\$ – Thijser Apr 30 '15 at 11:42
  • \$\begingroup\$ I have not unity right now. I posted an answer with a link to what solved my issue :) \$\endgroup\$ – Leggy7 Apr 30 '15 at 12:00
-1
\$\begingroup\$

the animation needs to be not in legacy (1) but in (2) as per being played.

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.

check out this link. It shows your opposite problem but it demonstrate how to enable debug mode.

\$\endgroup\$
  • \$\begingroup\$ Could you clarify this answer? I can not understand it, both grammatically and in context of the problem. \$\endgroup\$ – Gnemlock Jan 28 '17 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.