error cs0029

Assets/GameContent/Motiontracks/Editor/AnimationImporter.cs(60,52): error CS0029: Cannot implicitly convert type UnityEditor.ModelImporterClipAnimation[]' to UnityEditor.ModelImporterClipAnimation’

Once again I was trying to import animationsand apparently I can’t convert when I was trying to import a couple of animations.
Here’s the code:

ModelImporterClipAnimation clips = modelImporter.clipAnimations;

            Object asset = AssetDatabase.LoadAssetAtPath(assetPath, typeof(GameObject));
            AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);  

    private ModelImporterClipAnimation SetClipAnimationNew(string name, int firstFrame, int lastFrame, bool loop)
        ModelImporterClipAnimation mica = new ModelImporterClipAnimation(); = name;
        mica.firstFrame = firstFrame;
        mica.lastFrame = lastFrame;
        mica.loop = loop;

        if (loop)
            mica.wrapMode = WrapMode.Loop;
            mica.wrapMode = WrapMode.Once;

        return mica;

That means you’re trying to store an array of ModelImporterClipAnimations in a single ModelImporterClipAnimation variable.


ModelImporterClipAnimation clips = modelImporter.clipAnimations;


ModelImporterClipAnimation[] clips = modelImporter.clipAnimations;

That should be the flawed line, from what I can tell.