AnimationClip problem

Hello,

I got an Animation split into 40 clips.

But only 3 clips are correctly playing, the others just freeze at their first frame. They are lasting the correct number of frames, but objects won’t move.
I’m using the Play() method and Once wrapMode.

What is odd is that they do play fine if I check them one by one with a native drag and drop in the editor.

What is even more odd is that they do trigger fine if I set their wrapMode on Loop.

It’s a FBX import from C4D.

I checked if they were triggered several times, and they are not.

Did somebody experience the same issues ?

Ok, I found the source :

Do never change the Animation.wrapMode at runtime.

I don’t know if it’s a bug, but if I was switchin from Loop to Once by a keyboard trigger, the second animation would be stuck at first frame for its own duration.

I had to manage the wrapMode on the AnimationState directly (or animation[“clipname”] if you prefer).
Now everything works fine.

P.S : the first version was in Javascript and did work with Animation.wrapMode, but it fails in C#.
Clips are imported from a C4D FBX.