> For the complete documentation index, see [llms.txt](https://dante-3.gitbook.io/dante-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dante-3.gitbook.io/dante-docs/modular-attachment-system/modular-attachment-definition/common-patterns.md).

# Common Patterns

### Assigning at edit time

Place a `UModularAttachmentComponent` on an actor, then set `AttachmentDefinitionAsset` to your definition in the Details panel. The component auto-loads on `BeginPlay`.

### Swapping at runtime

```cpp
TSoftObjectPtr<UModularAttachmentDefinition> NewScope = /* ... */;
AttachmentComponent->SwapAttachment(NewScope);
```

Or in Blueprint: call **Swap Attachment** on the component node.

### Querying fragments after load

```cpp
// After OnAttachmentLoadCompleted fires:
UModularAttachmentFragment* Frag = Component->GetFragmentByTag(ScopeBodyTag);
auto* MeshFrag = Cast<UModularAttachmentFragment_StaticMesh>(Frag);
```

***
