> 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/indicator-system-plugin/indicator-descriptor/common-patterns.md).

# Common Patterns

### Floating name tag above a character's head

```cpp
Desc->SetSceneComponent(Character->GetMesh());
Desc->SetComponentSocketName(FName("head"));           // attach to head socket
Desc->SetWorldPositionOffset(FVector(0, 0, 20));       // 20 cm above socket
Desc->SetVAlign(VAlign_Bottom);                        // bottom edge of widget at that point
Desc->SetIndicatorClass(MyNameTagWidgetClass);
```

### Hiding an indicator temporarily

```cpp
Desc->SetDesiredVisibility(false);   // hide
Desc->SetDesiredVisibility(true);    // show again
```

### Distance-based culling

```cpp
Desc->SetMaxVisibleDistance(3000.f);  // hide beyond 30 m
Desc->SetMinVisibleDistance(100.f);   // hide closer than 1 m
```

### Screen-edge compass arrow for an objective

```cpp
Desc->SetClampToScreen(true);
Desc->SetShowClampToScreenArrow(true);
Desc->SetArrowBrush(MyArrowBrush);
```

### Preventing overlap in a dense crowd

```cpp
Desc->SetPreventOverlap(true);
Desc->SetOverlapPadding(FVector2D(10, 10));
Desc->SetPriority(1);    // higher priority = placed first, others move away
```

### Manually destroying a dynamic indicator

```cpp
// Blueprint
Desc->UnregisterIndicator();

// C++
Desc->UnregisterIndicator();
// Desc is now removed from UIndicatorSubsystem and the owning UIndicatorManagerComponent
```
