Menu

Dynamic IK Retargeting in UE5

unreal-engine icon

Dynamic IK Retargeting in UE5


April 20th, 2022

Overview

Unreal Engine 5 adds a powerful new feature called IK Retargeting.

We can take advantage of this feature in two main ways:

  • Statically retarget animation clips to a new skeleton
  • Dynamically retarget poses from one mesh to another

Either method requires the use of the new IK Rig and IK Retargeter assets.

Conveniently, the new UE5 templates come with IK Rigs and IK Retargeters out of the box for both UE4 and UE5 skeletons. So, if you're working with a mesh already mapped to the UE4 skeleton you're good to go. If you're using a custom skeleton, you'll just need to setup an IK Rig and IK Retargeter...both of which are pretty easy to do (see the links above for tutorials from Epic).

Dynamic IK Retargeting

Using the IK rig and retargeter that ship with UE5 templates, we can easily setup dynamic pose retargeting for any UE4 skeleton allowing us to use the fancy new animations and control-rig-based leg IK.

For this tutorial, I'll walk through setting up the UE4 mannequin and skeleton for the new UE5 third person character. I'll also then show how to import a custom character that uses the UE4 skeleton.

Creating the Animation Blueprint

The most important step is to create the new Animation Blueprint for the UE4 skeleton. If you've worked with Animation BPs before, this could seem tedious or daunting. But I'll go ahead and ease any concerns right now...we only need to add ONE node.

The node that we're going to add is the Retarget Pose from Mesh node. This is a powerful new node that will allow us to copy the pose from another mesh. You can pass in a specific mesh to copy the current pose from, or leave it empty and it will copy the pose from the parent SkeletalMeshComponent. That's what we'll do.

Create a new Animation Blueprint and select the UE4 skeleton. ik-retargeting-create-abp

Open the newly created animation blueprint and drop in a Retarget Pose From Mesh node. Next, select the node and in the IKREtargeter Asset field, select the RTG_UE5Manny_UE4Manny retargeter. Finally, connect this node to the Output Pose. ik-retargeting-rpfm-node

And that's it for the animation blueprint!

Configure the Character

We just have one more thing we need to take care of. It's going to seem a little strange, but trust me on this one.

Open the character blueprint (in my case the Third Person Character) and find the skeletal mesh component named Mesh. We need to make two quick tweaks: we're going to make this mesh invisible and we're going to make it so that it's animation poses still update while invisible.

We can do this by setting Hidden in Game to true. Next find the Visibility Based Anim Tick Option field and set that to Always Tick Pose and Refresh Bones.

Note: We're changing optimization settings here for the purpose of this tutorial. A better way to handle this is to do something like in the Lyra Sample Project and instead use a skeletal mesh asset that has no triangles aka and invisible mesh.

Now all we need to do is add a new Skeletal Mesh Component as a child of the existing Mesh component and select the UE4 mesh we want to use (in my case, the Ue4 mannequin) and select the animation blueprint we just created a moment ago. ik-retargeting-add-skm

Now simply play in the editor and see you character using a UE4 mesh/skeleton with the new UE5 animations and leg IK!

© 2023 Stefan Perales

Built with by peralysis