‼️Mesh Sync Setup
For compatibility with this asset, make sure you use the correct skeletal meshes, rigged to the same skeleton as the master mesh, for example, a clothing piece is rigged and weight painted to the same skeleton as the body mesh.
Mesh Sync is replicated by default, once the setup is done according to this documentation, every mesh will be synced across server and players. Mesh Sync is network optimized and allows for late-joining players, no need to worry about replication.

Step 1 - Add the MeshSyncComponent to your character

This is fairly straightforward, add the MeshSync component to your character.
Step 2 - Setup the data assets that contain the meshes for your character
Create a data asset of BP_MSMesh, this will contain the information of a specific body part.

Tip: Use a clear naming structure that defines what it is and which iteration it belongs to, for example: Character_Body_01, Character_Shirt_01 etc.
Pick BP_MSMesh and click Select, name it however you like


Click the + icon to add an entry, this is an array so you can add as many as you like, Mesh Sync will then randomly pick one from this list, this allows for complex setups.
Mesh Sync's Data Assets use soft references for the meshes, this keeps all the added meshes from loading into memory when opened in a data asset, this greatly reduces memory usage while it's not in use. Async loading is used to safely load the meshes in during play.
Now we can set it up, asset name is added as a tag on each skeletal mesh so you can identify each one if using Get Components by Tag node. Select a skeletal mesh to use and it's essentially good to go. The other options are not relevant for now. Repeat this for as many as you like.

Create another Data Asset for the body and repeat the steps above
Do this for every body part that you want to add.
The Master Mesh option should be enabled for the body, this is what decides what would normally be the Mesh on the top of the hierarchy of the Character blueprint.

Step 3 - Create a Data Asset that contains the other data assets we made previously

Select BP_MSType, In this data asset we'll add all the ones we previously made, therefore this data asset contains all the body parts. In this example I have named it "Example_Type_01"
Add as many as you like, with this flexible setup you can easily create many different combinations, swap out/re-use anything as you create more characters in your project.

Step 4 - Setup the MeshSyncComponent in your character
Now it's time to add the previously created data asset to the component in your character.

The "Actor Type" is the data asset that contains our list of body parts, the animation instance is what we normally select in the Mesh, this will apply to the Master Mesh. Make sure to enable Randomize Parts if you have multiple meshes in one body part, otherwise it will always select the first entry in the array.
Not necessary for now, but the option is there to add a BP_MSTypeDatabase data asset, this can contain as many Actor Types as you want, "Use Random Entry from Database" has to be enabled, and it will pick a random entry in the database, which allows for even more combinations. With this setup, you don't need to create child instances of your character blueprint for cosmetic changes, simply create more actor types and swap them out as needed.
You should end up with a similar structure like this, in this case there are a total of 4 body parts which are defined in the "Character_Type_01"

Last updated