# MML Attachments

{% hint style="success" %}
verified: 2025-12-08 version: v39
{% endhint %}

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 - they can be easier to use as replication is handled automatically, but they can't have custom colors or materials.

### MML Attachment format

The attachment MML files must be in a specific format, consisting of a single `<m-model>` node with 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>
```

### Adding and removing 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 (note that the same `RemoveAttachment` function is used for both MML and static mesh attachments).

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).

<figure><img src="/files/JrVcHrSXWbvi9LFwZJ6Y" alt=""><figcaption></figcaption></figure>

### 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.otherside.xyz/platform-documentation/creation/unreal-development/features-and-tutorials/avatars/avatar-attachments/mml-attachments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
