Problem with importing a weapon (skeletal)

I’ve rigged and animated characters before without any problems but for some reason I can’t import a weapon in unreal without getting errors. Here’s what it looks like inside maya. It’s a single mesh, it won’t be animated at all. I rigged it for testing purposes.

http://image.noelshack.com/fichiers/2017/30/3/1501086508-rig1.jpg

Usually when a character is rigged, the skin becomes the child of the bone hierarchy (at least that’s how I do it)

Here’s what happens when I drag the mesh on the root bone (in the outliner), the gun gets rotated by 90 degrees (I froze transformations before doing that so everything is set to 0 )

http://image.noelshack.com/fichiers/2017/30/3/1501086798-rig2.jpg

I couldn’t export the gun this way to unreal so I tried exporting the gun in various ways (by parenting the bones to the skin for exemple, which didn’t work, as expected). I’m getting import errors inside unreal (such as bones missing from bind poses), the rig kinda looks fine inside unreal but there’s a red bone sticking out from the root bone

http://image.noelshack.com/fichiers/2017/30/3/1501087917-unrealgun.jpg

Am I doing something wrong? :confused: