MML Attachments

MML can be used to define static mesh attachments that are stored online, and can be socketed to player characters during gameplay. This is an alternative to creating attachment meshes directly as Unreal assets, and can be easier to use.

MML Attachment format

The attachment MML files must be in a specific format, consisting of a single <m-model> node that specified a socket attribute. The simplest MML attachment will look like this:

<m-model socket="hand_r" src="https://my_url/model.glb"></m-model>

The socket must be the name of a bone or socket on the UE5 skeleton. When attached, the model's origin will be attached to the specified bone or socket.

You can also optionally specify an extra transform to apply, to translate/rotate/scale the model relative to the socket. This is the full set of attributes to define translation, rotation and scale:

<m-model socket="hand_r" src="https://my_url/model.glb"
  x="0.1" y="0.0" z="0.06"
  rx="90" ry="180" rz="0"
  sx="0.25" sy="0.25"sz="0.25">
</m-model>

How to add and remove attachments

You use the M2M_CharacterAssetComponent on a player's Morpheus actor to add and remove MML attachments. Calling Auth_AddMMLAttachment will add the attachment and return a handle. Pass this handle into RemoveAttachment to remove it again.

These functions can only be called on the authoritative client. The attachment is automatically replicated to remote clients, so no manual replication is required (unlike with static mesh attachments).

Live config

Each player character can use and replicate a maximum of 12 Carnival meshes. Because MML attachments are rendered using Carnival, each added attachment comes out of this budget. By default attachments are lower priority that normal character meshes, so if a player's avatar has too many individual meshes then attachments won't render.

You can use the Carnival.NumMeshesReservedForAttachments live config to control this. Setting this will ensure at least this many attachments are visible, and limit normal character meshes to the remaining slots.

Last updated

Was this helpful?