Blender to Unreal: Root Motion Not Applying

Hello, Unreal community! May I just say you look fabulous today?

So here’s the problem, which I initially posted in the UE4 AnswerHub (https://answers.unrealengine.com/questions/247220/blender-to-unreal-fbx-ascii-vs-binary-problems-wit.html). I’ll try to re-explain with the new knowledge I have.

I’ve been trying very hard for the past few months to get something with root motion to import successfully from Blender (2.74) to UE (4.8), but with little success. After trying many different things to get some models in, I finally decided to make the least complicated model I could, just to try and figure out how to get things to work. Here are the results:

First, my model in Blender. About as simple an armature model as possible, with only two bones, and a three frame forward walk animation.

47575-blenderarmature.png

After going through some of the things mentioned below (Some “Solved” Things) on AnswerHub, I got a nice little walking box-creature root-motion animation. However, I am unsure how to get this from the animation into the actual game, and therefore have several questions which have plagued me for quite some time.

In order to apply root motion to an actor:

  • Does the actor need to be a blueprint?
  • If so, does the blueprint need to have “Character” as a parent, with Character MovementMode set to walking (as was told to me in one of the originally provided links)?
  • Does the actor need to have an animation blueprint, or can root motion work through a simple animation asset?

And if those are all the case, why is it that way?

I have yet to get the root motion to show up in the actual game (though in the animation window with Show -> Process Root Motion checked, it looks perfect).

Unreal has great documentation, and this articleon root motion (which I have read numerous times) was no exception.

However, it still does not answer my questions. As it was written when AnimMontages were still necessary for root motion, I am unsure in what situations root motion now applies. The only clue I have is the following: “To fully utilize Root Motion, your character will need an Animation Blueprint”, which I cannot decide whether it means an Anim Blueprint is necessary, or that it is simply very useful in most situations.

Again, in the animation tab with “Process Root Motion” checked, everything looks wonderful, but I cannot figure out how to transfer this to in-game. I have tried making my Actor into a blueprint, giving it an Animation Blueprint, and having it extend Character with MovementMode set to both “walking” and “flying”, all to no avail.

Thanks in advance for anyone who can (or tries to!) help.
This is most of my question, but I’ve provided some more information below.

~Trekopep

[HR][/HR]

Some “Solved” Things:

This is with units in Blender set to metric, with a scale of 0.01, which has been (ctrl-a) applied to both the armature and the mesh. I exported an fbx two times, once using 7.4 binary, and once using 6.1 ASCII, with the rest of the settings like so:

ASCII:
This version imported seemingly nicely into Unreal. However, when turning on root motion, regardless of which Root Motion Root Lock option I choose, the forward animation “snaps” back into place after moving, rather than continuing forward like it should.

UnrealArmatureASCII.png

Comments: This happens because when using ASCII export/import, unreal adds another root bone to the skeletal mesh, and as I was informed by Blue Man (from AnswerHub) this can be solved by animating the entire armature in Blender instead of the root bone. This has been tested and confirmed.
However, when actually playing the game, the character did not move at all, despite being set to use the animation asset. (This is the main question.)

Binary:
This version imported at 100x larger than it should’ve. However, when selecting root motion in the animation view, it correctly moved forward, though the correct speed was 100x too slow relative to its body.

UnrealArmatureBinary.png

Comments: As per Adam Davis’ suggestion in AnswerHub, I tried exporting from Blender at a scale of 0.01, and it worked. Apparently, the applied in-Blender scale doesn’t correctly transfer over in Binary export. (This is what seems to be the case. If you have more information, please share!)
Again, when actually playing the game, the character did not move at all, despite being set to use the animation asset.

Also, in case anyone is interested, here are some of the similar problems I’ve been having, which are also unresolved, the first one especially being very related to this:

Root motion moves in opposite direction of intended - Character & Animation - Unreal Engine Forums Blender to UE4 Skeletal Mesh Explodes with Seemingly Multiple Roots - Character & Animation - Unreal Engine Forums

Hi
Did you fix your problem?
Does my solution work for you? (ASCII)

Blue,
Yes! It did work!
Unfortunately, while this is an excellent piece of knowledge, it still has the same problem as the Binary version, which is that the root motion works perfectly as expected when viewing the animation asset itself with Show -> Process Root Motion checked, but does not apply the root motion in the actual game.

Thanks again for the tip. Updating the main post to reflect this information now.

Good to hear :slight_smile:

Did you set Root motion from everything in your animation blueprint?


And here is good tutorial on how to set up root motion

Edit: I think that you need anim montage or you can use anim blueprint.

Sorry for the delay. I wasn’t expecting it to take a month for a company to fix my computer…

I didn’t see much in that tutorial that I haven’t already done.

Yes, I have Root Motion from Everything set, and I’m using an anim blueprint. In the picture below, you can see the Anim Blueprint. As simple as possible, and everything previews perfectly with “Process Root Motion” checked. However, in the actual game, nothing happens. The thing stays still.

I have been attempting to apply root motion using C++ without using CharacterMovementComponent, and was able to get it working with a small amount of code. Here is the simplest way I know how to do it. I put this code inside of a Tick function.


FRootMotionMovementParams RootMotion = Mesh->ConsumeRootMotion();

if (RootMotion.bHasRootMotion)
{
	FTransform WorldRootMotion = Mesh->ConvertLocalRootMotionToWorld(RootMotion.RootMotionTransform);
	UpdatedComponent->SetWorldLocation(UpdatedComponent->GetComponentLocation() + WorldRootMotion.GetTranslation());
}

“Mesh” is a SkeletalMeshComponent that is animated using an Animation Montage with Root Motion enabled (simply using an animation asset does not work), and “UpdatedComponent” is a SceneComponent that I want the root motion applied to. For my case, I have a Box Collision (UpdatedComponent) with a Skeletal Mesh (Mesh) parented to it.

Note: I don’t believe this can be done in Blueprints without exposing the necessary functions.