Importing Animations (armature only) FBXs bugged from Blender to Unreal Engine 5

Hey there,

Im almost done with the Course “Blender Complete Animator” (https://www.gamedev.tv/courses/blender-complete-animator). Now on one of the last lectures called “Exporting FBXs” Grant shows us how to export our Blender mesh and animations to fbx files so we can use them in game engines. In total we have 4 exports:

  1. Character Idle And Mesh (Includes Meshes and Idle Animation)
  2. Character Run Cycle (Only armature export)
  3. Character Trust Animation (Only armature export)
  4. Character Double Sweep Attack (Only armature export)

My export settings for Character Idle And Mesh have been:

And for all the armatures only my settings have been:

I firstly went ahead and brought the Character Idle and Mesh into unreal and it worked really nicely. Then afterwards I imported the armature only fbx and applied them to the characters in the game so i could see them move in unreal and, well… Tom (Sword Character) is moving perfectly fine, but the issue is the sword is at a weird location and has weird movement:
Weird Sword Animation

However, when I remove everything from unreal and export the double sweep attack WITH all the meshes just as I did for the idle animation before I get the expected result:
Complete Mesh Export

In the lecture “Holding The Sword” we bring the sword into blender to animate it with our character and by doing so we rotate it in object mode. I double checked and indeed, the rotation and scale is not applied for the sword. I tried applying it and no luck. Still this weird sword movement when I export the armature only for the double sweep attack. Here are the sword transforms in blender:

And here are the import settings from unreal:

Whats interesting is that after I applied ALL transforms, including the location, it would move the object origin to where the sword would be in unreal and the obejct origin seems to resemble the movement I see in the unreal gif. Maybe Im on to something here. (origin movement indicated by red lines)

Does anybody have any idea on how to fix this? I will try to look into it in more detail tomorrow.

Thanks so much!

1 Like

It seems that the parenting of the sword to the hand.r bone is getting corrupted somehow, when exporting it just the way we did in the lecture. But there are other ways to do it in case someone is also running into the exact problem. So to export the character and animations to unreal and get them to work you can do either of this approaches:

Approach 1: Export all actions at the same time with the character mesh
Rather than exporting the character mesh with the idle animation and then exporting each animation one by one we do this instead:

  1. Select the sword, hair, tom body and rig in object mode just as we did in the lecture

  2. Use these export settings:


    Notice the All Actions checkbox checked at the very bottom and we have both the armature and mesh selected at the top. You can skip the other selection, it wont do anything.

  3. In unreal we import our export fbx with these settings:

  4. Now simply drag an animation sequence into the viewport and you are done :slight_smile:

Since we exported all the actions and the mesh simultaneously it seems unreal doesnt get confused and applies the correct sword movement. The result will look like this:

Attempt 1 All Actions Export Unreal Showcase

The sword movement is not bugged anymore. Still, when we want to add another animation later in our game we will run into the problem, that we dont want to import everything from scratch again, which we could of course do, but maybe you tampered with some of the original animations or did something in unreal and you dont want to redo all the steps.

Instead we can use this approach:

Approach 2: Export the Sword separately and make use of Sockets in Unreal

  1. Select the hair, tom body and rig in object mode just as we did in the lecture, but do not export the sword, make sure it is not selected.
  2. Export the idle action and the mesh just as in the instructions above
  3. Export all the animations like thrust, double sweep, run cycle on their own just as we did in the lecture
  4. Now select only the sword in object mode, make sure rotation and scale have been applied. I also went ahead and cleared the location so the sword is back at 0, 0, 0 world coordinates
  5. Export the sword with mesh only settings:
    Mesh Only Selection
  6. Import first the character mesh with the idle animation
  7. Import all of your other animations
  8. import your sword
  9. Open the Skeleton of the character, NOT the skeletal mesh, but the skeleton (actually you can also work in the skeletal mesh for this one, but open the skeleton if you want to exactly follow my steps in here)
  10. Create a weapon socket which we want to add the weapon to soon. To do so, we search for the hand r bone which, if you remember, we parented our sword to in blender.
  11. Make a new Blueprint Class, have it be derived from Character Class (can also use SkeletalMeshActor Class if you want)
  12. Open it up, set the skeletal mesh to be our Tom skeleton and add a new static mesh component undearneath your skeletal mesh as child. Let the mesh of the static mesh component be our sword, parent it to the WeaponSocket we created earlier by clicking on the folder icon and selecting WeaponSocket. Move your sword into place. (Hint: you can play the animation and adjust the sword position midway through. To pause the animation, select your skeletal mesh component and untick the playing checkbox)


13. Now compile and save
14. Drag as much of your CharacterBlueprint Classes into your level as you want
15. You can now change the playing animation for each instance in the viewport:

Now the second approach is probably the cleaner approach here, because you could easily create multiple characters with either long or short swords and swap weapons easily by using the WeaponSocket. That being said I still did not find out how to fix my original bug where the sword location seems to be corrupted when importing as we did in the lecture. I did read somewhere that you have to name your Armature “Root” for unreal apparently or it could get buggy, but trying to rename my armature to Root did not help to fix the bug. These 2 approaches however should provide you with 2 workarounds in case you need to. I will let the question stay open in case someone finds a solution to my original bug.

If I find out anything new I will let you know. In case the thread will be closed by then, pay attention to the linked section underneath the post. I will try to remember to link to this post from the new thread then.

Cheers,

K -

2 Likes

Thank you for that well illustrated Guide to Getting things into Unreal.
Always a problem to Blender users as more than is realised by game makers never ever look at any game engine.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms