Skip to content
Back to wiki

Mesh Swapping & Animation Retargeting

Created: Apr 20, 2025Updated: Oct 28, 2026

Intro

In the demo project, all Lyra animations and animations integrated from third-party animation packs are associated with the UE5 standard skeleton found in GenericGame/Shared. All my other systems share this skeleton.

If you are using pre-made Lyra animations, you do not need to handle animation migration. With GMS, you can quickly add locomotion animations to characters associated with any skeleton.

Compatible Skeletons

If you are starting a new project, I recommend using the skeleton provided by GMS. If your project has already begun, but you have your own UE5 standard skeleton, you can add GMS's skeleton to your skeleton's "compatible skeleton" list. This way, characters associated with your skeleton can also use animations associated with the GMS skeleton.

Offline Animation Retargeting

If you already have an ongoing project, and your main character is not using the UE5 standard skeleton, and your character's skeleton significantly differs from the UE5 standard skeleton, you may need to use offline animation retargeting feature in UE 5.4 to migrate animations associated with the GMS skeleton to your character. This can be a cumbersome process.

Runtime Retargeting(Recommended at start)

GMS provides a BC_Lite_RetargeterManager component and a generic animation blueprint ABP_Lite_Retargeter.

This allows you to test and validate animation retargeting results between different skeleton characters before performing offline animation retargeting. It’s also not advisable to start with offline animation retargeting in the early stages of your project, as you will face a significant mental burden managing and migrating a large number of animation resources.

Preparing for Runtime Retargeting

Find the character's main Skeletal Mesh component and use it as the Source. The companion project's BP_Character_Humanoid uses the component tag CharacterMesh, which matches the default SourceMeshTag. You may choose another tag, but it must match the manager's SourceMeshTag.

On the SourceMeshComponent, it is recommended to set VisibilityBasedAnimTickOption to Always Tick Pose and Refresh Bones for testing.

Then, attach another SkeletalMesh component under the Source called RetargeterMesh, and add a "RetargeterMesh" tag to it. We will refer to this component as the Target.

Setting Up the Runtime Retargeting Component

Add the BC_Lite_RetargeterManager component to the character. This component will automatically query and set the corresponding components based on SourceMeshTag and TargetMeshTag.

  • Enable: Enables the component. It is disabled by default on the companion project's BP_Character_Humanoid; enable it before testing runtime retargeting. When disabled, it does not modify the Source or Target.
  • Randomized: Decides whether to randomly select a character from the Retargeters list for runtime redirection.
  • SourceOverrideMeshAsset: The selected mesh from the Retargeter will be set to the Target component. Here, you can specify a model to replace the original mesh on the Source component. GMS provides SKM_Manny_Invis, which has skeleton information to drive animations but is invisible.

Configuring the IK Retargeter

Assuming you have your custom character SKM_YourCharacter, and you want to use the animations provided by GMS, you should create an IK retargeter from SKM_Manny to SKM_YourCharacter. In UE5.4, you can use the automatic retargeting feature to createIK_Retargeter assets.

You can then configure the characters you want to use in the Retargeters array of this component and specify their gender.

If retargeting does not take effect, first check that the component is enabled and that the Source and Target component tags match SourceMeshTag and TargetMeshTag. Then check that the Mesh and IK Retargeter in Retargeters are suitable for the two skeletons.

Listening to Events

Whenever this component selects a specified RetargeterInfo, an OnChange event is triggered. You can access the information from the Retargeter and execute any custom logic.

For example, as shown below, I added different GameplayEffect based on gender to assign different gender tags to the character.

Video Tutorial

You can also watch the video version of runtime retargeting.