Unity not finding animation

I made a shooting animation for my pistol, attached it onto my pistol object, wrote the script for it to work, checked of “Play automatically”, and started the game, but it told me that the animation needed to be marked as legacy, and that it could not be found. I marked it as legacy, and it still could not be found, but I couldn’t edit it in the animation editor anymore. So I made another animation. It did the same. I cannot figure our what is causing this, so any help is appreciated

I just figured it out! I am not sure what I did, but after fiddling with all of the options, I got it to work!