So i want to animate a gun. Probably just the mag. Do i have to create mag in another file?
Do they “HAVE” to be contained in a separate file then no it is not a requirement depending on the over all game design.
If for example you are making a TF2 class based game then all animations for player, actions and weapon animations can be contained with in a single file and layer by bone as proper function by weapon. This can also be extended to player model design with limited load out as weapon use like the addition of a side arm and knife or grenade.
If for example you are doing a Unreal Tournament type game play then the game becomes weapon driven where the specifications necessary to make the weapon functional is maintained, as to best practice, by blueprint as a class that can be added to a load out and the specifications that applies to the weapon is polled upon position This would included 1st 3rd person animations as well as animations that makes the weapon functional as referenced by 1st and 3rd person.
The above of course depends on the code migration requirements of the game but as far as authoring goes for the most part can be animated in place using the target weapon and then retasked based on the need to fit the asset into the required migration pathway.