Matching skeletal meshes and animations (Blender to Unreal import/export issue)

I’ve been trying to fix this for days (maybe even weeks at this point). How do I export an object from Blender to be socketed in Unreal, while maintaining the same relative distance as a Child-Of constraint in Blender? Both are skeletal meshes.

With constraint on:

Constraint off (for exporting):

Child-Of settings:

When socketed to the hand in unreal (180 degree rotation on Z, otherwise zeroed):

Or is there a better method for achieving the same result (synchronizing two skeletal meshes)? I’m currently using the “Blender 2.8 For Unreal Engine” add-on when exporting. Trying to manually place and rotate the gun seems impossibly difficult… especially for precise animations, such as reloading.

If there is any vital information I forgot to include, just say and I’ll gladly retrieve it.

usually, you do everything in engine as far as positioning goes.

So if you animate a gun you place a gun bone within the skeleton and animate it. You later on attach the gun to it and position it correctly.

when you run a gun trick animation, say to make it spin around a finger, that gets done with the whole character by animating the weapon bone.

The position of the gun in egine will be based on the location of the bone as the starting point.

The position of the gun in blender will be based on world 0,0,0 unless you apply transforms and is subject to changes.

In either case the gun’s object origin is the point where attachment occurs, so you can do the math between the bone you add and the gun’s origin (after you apply transforms or a constraint to move it) to determine the values you have to use in engine.
note that rotations may differ with sockets.

Thank you for the reply!

I have now figured out why the positioning seems off whatever I do. The problem seems to be using “Preserve Local Transform”, which offsets the characters left hand slightly. The problem now is slightly more hilarious, but still annoying:

Animation with preserve local transform (notice the clipping):

Animation without preserve local transform (spaghetti):

After some searching, it turns out that Blender needs to have 0.01 (Meters) unit scale and the rig needs to be scaled to 100x and applied. This should allegedly fix the issue. The problem now is that there doesn’t seem to be a way to accomplish this without breaking the entire rig, as seen here:

Even detaching the mesh first doesn’t work since there appear to be SOMETHING that is still connected to the mesh. The rig is created using UEFY and I don’t fully understand how everything is connected, which is part of the problem…

The problem is also uefy.
but if your scale wasn’t correct to begin with you need to start over.

Unparent the mesh. Copy it. Move it to a new file. Set the scale. Apply transforms.
Copy the metarig you had, or adopt a new one. And run the rigify rig.