Smooth character transitions between gameplay and sequencer, capsule movement.

If I want to animate an ACharacter moving around in a level sequence, then afterwards return to gameplay with that character located where the sequencer ended, what’s the proper way of handling that movement? I can bind in-game actors to the proxy actors set up in the Level Sequence. But it’s unclear what the ideal way of making the transforms of the characters match between the sequence and post-sequence when returning to gameplay.

If root motion is disabled on the animations, the skeletal mesh will animate and move around, but as expected with non-root motion animations, the actual character position/collision capsule will just stay put rather than moving around with the animation. However the same happens when root motion is enabled on the animation, the capsule doesn’t move along with the character. See the chart below for the result in Sequencer when the animation has Root Motion and Force Root Lock enabled.

`A B C D
Enable Root Motion: 0 1 0 1
Force Root Lock: 0 0 1 1

A, B: Capsule doesn’t move, character mesh does.
C, D: Capsule doesn’t move, character runs in place.`

In earlier versions of the engine, I would right click on the Transform track and “Import From Animation Root” to import the root data into the transform track. This would properly update the collision capsule of the character during the Sequence so at the end of the sequence the collision capsule would be located in the correct location. However this solution was cumbersome and required reimporting if the animation changed. Is this the expected workflow?

I’ve seen mention of setting Swap Root Bone Actor on the animation track to handle updating the position, however I can’t find much documentation on how this feature is supposed to work. When I set it, it seems to lock the character at the origin and I’m unable to move it. What is the intended use case of the Swap Root Bone?

Any insights on this would be greatly appreciated.

Steps to Reproduce

  1. Create a new project using the Third Person Map template.
  2. Drop a BP_ThirdPersonCharacter into the world.
  3. Create a new Level Sequence, and drag that BP_ThirdPersonCharacter into it.
  4. Remove the Control Rig track (CR_Mannequin_Body)
  5. Add an animation track, using the animation MF_Run_Fwd
  6. Attempt to get the animation and Collision Capsule moving in unison as you play the Level Sequence.

Hey,

Swap Root Bone is a tool to use for this, but it’s support isn’t “great” yet. We’re working on some improvements coming in the engine to handle this much better overall. That said, I can explain how to use it here.

There are 3 types of swap root bone.

1: None - This is self explanatory, but it takes all motion from keys within sequence to handle positioning post sequence.

2: Actor - This is the primary use case, but what it does is take the root motion from the animation sequence that is playing, and applies that root motion to the capsule of the actor. There are 3 caveats on how to use this properly though.

  1. When you turn this on for the animation section, you need to make sure that root motion animation is turned on for that sequence. Root lock doesn’t matter per se, but you’ll want to make sure that your root position to it’s child bone are relatively the same..
  2. The root motion extracted to the actor is direct, meaning that you need to pay attention to the forward direction of your character’s root bone to the actor. Often, we animate in Y forward from Maya, but the capsule is X forward. This will cause the animation to move sideways. You can offset the character, but the more offsetting your do to teach component, the more likely blending can go wrong.
  3. Because you want to transition from and to gameplay from your player character, you’ll need to set the Start Location Offset property of that section. This can be cumbersome, but here’s a screenshot on how to set it up.

[Image Removed]

3: Component - This is the same as above, but it applies the motion to a specific component binding. This doesn’t move the actor though.

The last thing to pay attention to is setting the property of your actor section and animation section to Keep State.

1: Yes, this is known and will be addressed in the future.

2: This is most likely a bug. There are a few with transform origin at the moment. Again, the swap root bone system is not fully featured and compatible with all systems. As I mentioned, you may want to calculate the offset, including the transform origin position, with Start Location Offset. If you are trying to use the transform origin with a moving target and root bone offset, this most likely will not work right now.

3: Swap root bone extracts the motion of the animation, is offset by Start Location Offset, and is played from that position. The transform track is added on top of that. If you want to persist the position, you will need to turn on “Keep State” on the transform track.

4: Yes, this is a tricky problem, you could consider trying to right-click on the next section in the sequence and turn on “Match with this bone in previous clip”.

5: Yes, that data is property data that needs to be saved with the sequence, unless you are modifying externally using the director blueprint.

Thank you Dustin, this is great information.

Regarding point 2, I’ve run into this when importing the root data using “Import From Animation Root” also. At the time I got around it by attaching the actor to another “offset” actor in sequencer, rotated 90 degrees, and then rotated the proxy actor 90 degrees the opposite direction to make everything line up. It was quite messy. What do you think the best way to handle that situation is? Just exporting from Maya differently so the animations align without rotation? Or would the “Start Rotation Offset” you mentioned above take care of that?

There’s a couple of options.

The first is the one you kind of talk about. Animate your character with the root x forward, z up (matching unreals inputs). The new interchange formats have offsets, but it will take your curves as they are, meaning that your root will be rotated, but still facing the wrong direction.

Second, you can add a transform track to your mesh and rotate the actor to face the correct direction. But like I mention it will stack and as you mentioned it can get a bit messy.

Lastly, you adjust the animations using sequencer and control rig with the FK Rig. to match your needs.

Start Rotation Offset, is more about capsule orientation from the start of when your root motion takes over.

I’ve been playing around with this for the last couple of days, and am running into some problems getting this Swap Root Bone system to work. I am on 5.5.4 and have pulled a couple of changes from source from the newer versions of the engine (37090119 and 37309153), but still am getting weird behavior trying to set this up. I’ve also downloaded the UE5.6 preview from the Epic Games Launcher just to try some things there. The following issues I see in the UE5.6.0 preview.

  1. Potential Bug: When first setting an animation to use Swap Root Bone Actor, it seems to require me resetting the editor before that setting takes effect. Closing the Level Sequencer, switching between different Swap Root Bone types, loading into a different level and then back again, and starting and stopping Play In Editor all have no effect. Once the editor has been restarted, I can switch between Swap Root Bone Actor and Swap Root Bone None on that specific animation track and see it update correctly without having to reset. But if I add a new animation track and set it to Swap Root Bone Actor, I have to reset the editor to see the change.
  2. How does Swap Root Bone Actor relate to the LevelSequence’s TransformOrigin/TransformOriginActor and Override Instance Data? It seems to completely ignore the TransformOrigin when SwapRootBoneActor is specified.
  3. Likewise, how does it interact with a Transform track on the same actor? The very act of adding a Transform track to the actor seems to correct the rotational difference between how the animation was animated in Maya and how the character is rotated in game. However, having that transform track causes the character to snap to a location after the SwapRootBoneActor animation is finished instead of staying where the animation finished. Is a transform track on the actor incompatible with the SwapRootBoneActor animation track, and if we’re using SwapRootBoneActor, we’re expected to fully fill the timeline with those animations?
  4. Also, would you expect to be able to fill the timeline with different kinds of SwapRootBone animations? For example, start with a SwapRootBoneActor animation to move the character, followed by a SwapRootBoneNone animation that was authored with the root at the origin that just plays an idle animation where the character was left, and then play another SwapRootBoneActor to move the character to somewhere else? Edit: it looks like this is possible as long as that middle SwapRootBoneNone animation is on a separate Animation track. If you try to put them all on the same track and blend between them, the middle animation will warp back to the origin to play.
  5. It looks like setting StartLocationOffset and StartRotationOffset is actually changing the values in the sequence animation track itself. So the first time I add an animation in the sequencer, mark it as SwapRootBoneActor, and scrub through it, it’s playing in one place. But then after I play in editor, the track has been modified so will play in a different place from that point on. It doesn’t actually mark the file as dirty, so the next time you load the sequence it will be back to its original place unless you explicitly saved it.