I saw a similar thread before but no answer. Is this a known issue in Unity 4? Is there a workaround besides adding the clips in the editor. I was hoping to do it in code behind but I am only a few days into Unity so I appreciate advice.
AddAnimationClip("Idle",0,74);
AddAnimationClip("Forward",76,94);
void AddAnimationClip(string name, int start, int end) {
animation.AddClip(animation.clip, name, start, end);
animation[name].wrapMode = WrapMode.Loop;
}
var s = animation["Idle"].length; // both of these have the same length, which is the length of the entire sequence
var y = animation["Forward"].length; // both of these have the same length, which is the length of the entire sequence
It causes the animation to stop for the remainder of the length and then loops back around. I noticed that length has no setter.
Thanks!
Any progress on this issue? This bug is driving me nuts! Basically, Animation.AddClip() with frames is useless?
Same here, and we need it too. When reimporting models it’s just plain easier defining animations in code ONCE than in the editor everytime you reimport the model (or we are doing something wrong) 
The same issue I’ve got. AddClip duplicates the animation clip leaving not mentioned frames empty
This bug infuriates me.
I had all my character animation working perfectly, then I made the mistake of upgrading to unity 4. Of course all my animation is setup in code via AddClip, so thank you unity… thanks for leaving legacy animation behind if favour of that mechanim sh1t.
I’m having the same problem in the newest version (4.3.4f1). Did anyone find a workaround to this problem?
I know, I’m necroing this post.
But this just bit me today in 4.6.1.f1, so not cool.
Does anyone have any new information on this bug? We use legacy animation heavily (mecanim just doesn’t meet our requirements), and this makes my job so much easier. We have 8 way animations with 3 phases to each 8 way, and 4 different versions of those 8 ways… broken up is 96 clips. They all are the same size, and in the same layout… so it’s easier to just export one large animation that I programmatically break up in code… that way the designer just drops the large AnimationClip onto my animator script, easily choosing which anim set to use for that character… without having to 1) split up the animation into it’s 96 parts, then associate those 96 parts with the script.
(and don’t get me on trying to set this 8 way up in mecanim… we tried… holy god was that a cluster fudge nugget of a animator state machine… ugh! Some things are just WAY easier in code Unity… stop trying to hold my hand so freaking much!!!)