Using UE4 meshes in Lyra
How Lyra mesh is created
To create visible character mesh, Lyra, by default, is using B_PickRandomCharacter
component defined in an experience definition. It’s implementation is calling the Add Character Part
function on begin play event and selects randomly one of the two:
B_Manny
- or
B_Quinn
Both of the above are Lyra Tagged Actor
sub classes and contain only one component, a skeletal mesh component. This actor is then spawned and added as child actor to the main character actor in runtime.
Setting UE4 based character mesh
Start by creating new blueprint based on the Lyra Tagged Actor
. You can duplicate any of the existing ones too. In skeletal mesh component properties update skeletal mesh asset with the one you want to use. **Then, set the animation instance to ABP_UE4_Mannequin_Retarget
. This will ensure that Lyra animations are “translated” to the UE4 skeleton/mesh we just set.
Create new blueprint based on Lyra Controller Component Character Parts
to replace the B_PickRandomCharacter
. Name it however you want and inside it’s implementation simply call Add Character Part
. Make the required struct and set the newly created Lyra Tagged Actor
as the New Part Class
property. Do not change any other properties, they are fine with their default values.
Now inside the experience definition replace B_PickRandomCharacter
with the new component you just created.
Enjoy your new character mesh visible on the screen!