Look I’m working with Unity 2022.3.2f1 with the legacy animation system and so far it has always been reliable to me until just recently when I tried to add a new animation to my character that has already 857 animation clips to it. (Yeah that’s a lot). So adding a new clip makes it 858 and it gives me this error → Assertion failed on expression: ‘m_UsedFileIDs.count(fileID) == 0’…
I just hope this can get fixed because legacy suits me well and I tried the mecanim stuff and it’s a hassle to me.
So is there really a limit to add animation clips with legacy?
The workaround is to enter your gameobject Import Settings by clicking “select” go under the “Animation” tab (like you always do when you want to add a new animation under legacy)
Add two animations (if you want to only add 1 and I’ll explain under) than click “apply”
Then you select the same game object in the hierarchy and manually add an element to your animation list…
Then search for the animation you want to add in your project window and manually drag it to the element slot you’ve just created.
The reason I need to add one additional animation is because It throws this ‘m_UsedFileIDs.count(fileID) == 0’ error after clicking “apply” and that first animation created is worthless because it seems to take the properties of an already existing animation. There’s a conflict that happened somewhere at my 857 animation and I don’t know why but it will always replace the first animation (worthless one) when I drag it to the element slot.
I used to click apply in the animation tab and I didn’t have to manually create a new element to my gameObject’s animation list after. It would automatically create it.
When you know your animations are correctly added you can go back in the animation tab and delete the first animation you made (worthless one) …I let it named “Take 001”.
Weird, I haven’t switched unity version and I’m not getting that Assertion failed error anymore but when I create a new animation clip I still have to manually create a new element to my animation component in the inspector and drag that new animation.
The way I worked around this issue explained above worked until I updated my project to 2022.3.6f1.
With 2022.3.6f1 when I create a new animation clip and click Apply I get these errors:
InvalidOperationException: Stack empty.
EndLayoutGroup: BeginLayoutGroup must be called first.
Assertion failed on expression: ‘m_UsedFileIDs.count(fileID) == 0’
…in the project window I’ll find the new animation clips by their names but then when I click on them the inspector window gives me the wrong animations.
Looks like I’ll have to keep adding my new animations with 2022.3.5f1 if I want to upgrade my projects to a new LTS version.
Maybe it is outdated thread but I searched for the more info about it myself and I manage to fix it.
If anyone have this problem…
This error is related to duplicated ID. In this case it might be the issue with adding(creating) to many animation clips from existing one:roll_eyes:. However solution is simple just edit the *.meta file of the imported model (You can do it even in notepad, but I recommended more advanced editor). Search for your just added clip name and check if other animation clip that exist has the same name, if so, change the last number in internalID: row for added clip. For example for -2146527444935883628 to -2146527444935883629.
Most errors in unity occurs with meta files. I don’t know why, but as long as they are easy editable it is not a big problem.