In this post, we explore how we can integrate a complex custom mesh with ALS.
The first part is documented in this video:
The video is adding ALS into your existing project and the second part is integrating your skeletal mesh to utilize those animations.
For this post, I will integrate the Sylized crusader outfit from N-Hance studios.

Preparing for the integration
First let’s prepare a couple of basic requirements, such as the game mode and the map.
Let’s start by adding a new Game Mode.

When selecting blueprint for parent, select the ALS_GameMode_SP
as it will include some requirements you will need. Name it whatever you like, I called it OurGameMode
for this test.
We will modify the Default pawn class
but we will do so after creating the pawn we want.
Next, let’s add a new level that we will do the testing on, or use an existing one.
Simply click File -> New Level to do this.

I selected a ‘Basic’ level to do the testing on.

Once it loads, you will want to open the World Settings and set the Game Mode Override to the newly created Game Mode.

Add your new assets and character to the project
Now you’re ready to start adding your character and assets to the project.
When I add my assets in, this is what I have:

Now we will create some sort of a character hierarchy, to help refactor code and logic in the future.
A very quick example of what you can do is:

This is optional, but may help you refactor certain code logic. For example, if all characters require the logic, it can live in Player Base. If only humans have certain logic, it will live in the human blueprint, etc.
For now, I will just create two classes, the Player Base and the actual Human Male player character.
To create a Player Base blueprint, simply right click and create a new blueprint, then when choosing the parent, select the ALS_CharacterBP
.

This will create essentially a clone BP for the ALS character, which we can extend.

With that ready, we can start extending it with the character BP that we actually want.
Creating our ALS character with skeletal mesh we want
Now we’re ready to create the BP which will extend the player base and will contain the skeletal meshes that we want.
Create a new blueprint which extends the newly created Player Base character BP.

What you want to do now is to copy and place all the skeletal meshes from your custom character into the newly created blueprint, which I called hu_m_character
.

You will still have the Blue character visible, which is fine.
At this point, you will want to start preparing the animation blueprint.
Preparing the animation blueprints
We will use a IK rig to help us out with animations.
From inside the ALS character blueprint or the player base, you will be able to find reference to the ALS_AnimBP_C
.

Click on the little folder with magnifying glass icon to locate it in your folder. You will need to have the mesh selected to see it.
Once its located, you will want to right click and select Retarget animations

When retargeting, you will need to select the target skeletal mesh. In my case with (what appears to be all their assets) n-hance studios, its _full_body
skeletal meshes, they are split depending on the race/gender variant, such as SK_Hu_M_FullBody
.
In this case, the Auto Generate Retargeter works very well and I will use it.

Rather than exporting the animations, we will export the retarget assets.
Select retarget assets and save them to a location.

This is what it will generate:

You can open the RTG_Auto_Generated
and test it with some animation assets to make sure its functioning as you require.

As you can see with animations playing, the two assets overlap very well, meaning the retargeting worked as expected.
Create the animation blueprint for your character
Now with retargeter available, let’s create the animation blueprint which will be used by the character blueprint.

As you can see, I called mine hu_m_anim_BP
. Select the skeleton for the character, in my case it was SKEL_Hu_M
.

Open up the animation blueprint and we will make 1 simple change here, we will add retarget pose from mesh
function:

In its settings, we can add the IKRetargeter asset, which will be the RTG_AutoGenerated asset we created earlier.
The animation blueprint is ready!
Updating the character BP
Now that the animation blueprint is ready, we want to update the character blueprint to use it.

Select all the new meshes you added to the character (some assets will just be 1 skeletal mesh) and update the Anim Class to the newly created one, in my case hu_m_animBP_C
.
Next, select the mesh with the ALS character mesh and search in details for Visible and we will want to disable it.
Here you will also find under advanced, Visibility based anim tick option and you will need to set it to:
Always Tick Pose and Refresh Bones.


As you can see, when the visibility is disabled, only our new character mesh is left visible.
Final touches
Now our character is ready for testing. We simply need to start using this character and reference it in the game mode.
Open up your game mode and set the Default Pawn Class to the hu_m_character that we created and this should be everything! It should already be referenced in the map world settings.

Click play and test it!

You may want to then create new blueprints for the different variations of characters, such as male, female or different races, like orcs and dwarves. You will want to control them through something like a character select screen and spawn the relevant character to the game.
Good luck with your project!