MML Attachments
Last updated
Last updated
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.
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:
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:
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).
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.