# Nameplates

{% hint style="success" %}
verified: 2025-11-19 version: v39
{% endhint %}

In [Example Plugin](/platform-documentation/creation/unreal-development/features-and-tutorials/the-m2-example-plugin.md), we have an example component, `BPC_M2Example_NameplateComponent`, which displays players' usernames over their heads, along with their recent chat messages.

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

## Features (and limitations)

* Players in the rendering LOD 0 will have nameplates over their heads
* Visibility checks are used to hide the nameplates of players that are blocked by scenery
  * The visibility checks run on a 1 second timer, so will not apply instantaneously as characters move e.g. behind scenery
  * The example's visibility checks are pretty simplistic, running a single line trace to the center of the character, so partially visible characters may or may not have nameplates visible
* If players with nameplates move closer/further away, their nameplate will get larger/smaller
* If players with nameplates send chat messages, they should appear over their heads.

## Implementation Details

### The nameplate component logic

`BPC_M2Example_NameplateComponent` is a `WidgetComponent`, attached to the `BP_M2Example_PlayerCharacter`'s head, the which displays a `WBP_M2Example_Nameplate` widget.

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

* The widget "distance" calculations are done in the component's tick, to update the scale of the widget based on how far away the player is from the camera.
  * If `DistanceCullingEnabled` is true, this will also hide the widgets if their square distance is outside of `VisibilityDistanceSqrd`.
* The "visibility checking" is run in a separate timer at a lower interval (`LOSTimerIntervalSeconds`)

  <figure><img src="/files/t5t91EML3bCj8eqOK1ZJ" alt=""><figcaption></figcaption></figure>
* The component needs to listen to the pooling events (see [Actor Pooling](/platform-documentation/creation/unreal-development/features-and-tutorials/actor-pooling.md)), to make sure that the nameplate of the current actor reflects the correct corresponding Morpheus Actor.![](/files/gLvqTvC3qYlbRroqfPY4)

### The player name

To determine the local player's name, we need to use the "Profile data provider" world service (see [World Services](/platform-documentation/creation/unreal-development/features-and-tutorials/helpers-and-extras/world-services.md)). This service is responsible for getting your player name from the web platform, and applying any name changes back to the web platform.

For other players to see your player name, we need to replicate that within Unreal. This is done in the `BPMC_M2Example_PlayerNameComponent`.

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

The `WBP_M2Example_NameplatePlayerName` widget (a widget within `WBP_M2Example_Nameplate`) then listens to this replicated player name updating, to update the nameplate.

### Chat on the nameplate

The nameplate listens to the unreal chat system outlined in [Unreal Text Chat](/platform-documentation/creation/unreal-development/features-and-tutorials/communication/unreal-text-chat.md).

This is done in `WBP_M2Example_NameplateMessagesContainer` - another widget within `WBP_M2Example_Nameplate`.

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


---

# 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/the-m2-example-plugin/nameplates.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.
