My idle animations don't work

I am new to animations and recently I made a gun and I was working on the animations so I started off with the idle animation.


This is the animation I made in the editor, but for some reason when I equip the gun in game it turns out like this.

I don’t think It has anything to do with the script because the animation is still playing, but if anyone knows how to fix this I would appreciate it.

Tool animations have to be under the animation type “Action”