> For the complete documentation index, see [llms.txt](https://docs.msquared.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/the-m2-example-plugin.md).

# Example Plugin

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

The `M2 Example` plugin acts as an slightly more fleshed out starting point for Morpheus Platform projects, adding some example/reference features, which users can then learn from or build upon in their own projects. Features/functionality added in this plugin are not considered core Morpheus Platform functionality, but have been added to show how such features could be added in downstream projects, using a combination of core Morpheus Platform functionality, and native Unreal.

<figure><img src="/files/eAjv7LQHZWKKSYCxI7if" alt=""><figcaption><p>The Example Map acts as the starting point for new projects, showing examples of Morpheus Platform functionality in action</p></figcaption></figure>

## Outline of the content

Some of the features added in the M2 Example plugin:

* The `ExampleMap` - a simple map designed to be the entry point for new projects, showcasing core Morpheus Platform features with simple examples.
* Some example core classes, e.g. the `BP_M2Example_GameMode`, and `BP_M2Example_PlayerCharacter`.
  * Some further details on the core character classes can be found in [The Example Character](/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/the-example-character.md)
* A basic example UI setup (see [UI](/creation/unreal-development/features-and-tutorials/ui.md))
  * Includes an example settings menu (`WBP_M2Example_SettingsMenu`), showing how to modify things like your profile name, your avatar URL, and audio & graphics settings

    <figure><img src="/files/TqMQHujmXPeBOEiJ0Fus" alt=""><figcaption></figcaption></figure>
  * We include an example ["UI Mode"](/creation/unreal-development/features-and-tutorials/ui/ui-mode.md) toggling system, to enable users to switch between a "game mode" (where the mouse is captured and used as camera rotation), and a "UI mode", where the mouse is released, and users are allowed to click on things.
  * We have enabled a key binding to disable the main game HUD. This does not disable all visual elements such as Nameplates or any project-added widgets that are not attached to the player's HUD. See `BP_M2Example_PlayerCharacter` for implementation details.
    * Press `Ctrl+Alt+H` to toggle visibility
* Its own bot behavior store (`BP_M2Example_BotBehaviorStore`), and custom bot behaviors (e.g. `BT_M2Example_BotTextChat`), to test out the example plugin-specific functionality. (For more details on how bots work and are configured, see [Bots](/creation/unreal-development/features-and-tutorials/bots.md))
* An example Unreal text chat system (see [Unreal Text Chat](/creation/unreal-development/features-and-tutorials/communication/unreal-text-chat.md))
* An example Nameplate component, that displays their profile names, and their recent text chat messages (see [Nameplates](/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/nameplates.md))

  <figure><img src="/files/cQm0Uq5BJ5YegVUv2akX" alt="" width="356"><figcaption></figcaption></figure>
* Example "resizing" functionality (see [Resizing](/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/resizing.md))
* Example usage of the [KV Store Service](/creation/unreal-development/features-and-tutorials/online-services/kv-store-service.md)
* Example video player (see [Example Synced Video Player](/creation/unreal-development/features-and-tutorials/video-players/streaming-video-player/example-synced-video-player.md))
* Example "footsteps audio" (see [Footsteps Audio](/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/footsteps-audio.md))
* Example "observer cam" pawn (see @ObserverCam)

Any functionality that you are interested in using in your project, please have a look, and copy whatever is useful for you!

### A note on the example classes:

The example classes, e.g. `BP_M2Example_PlayerController`, have been set up based on a minimal base class, adding some example functionality. We believe these to be a reasonable starting-off point, but they are not the base-most classes that can be used, if you want to start from scratch. Please consider the following:

<table><thead><tr><th width="124">Class</th><th width="250">Minimum supported base class</th><th>Context</th></tr></thead><tbody><tr><td>Game Mode</td><td><code>M2_GameMode</code> (C++)</td><td>The M2 base class adds essential functionality for operation with MSquared, such as the <code>PlayerMorpheusActorClass</code>.</td></tr><tr><td>Player Controller</td><td><code>PlayerController</code> (C++)</td><td>All additions to the base player controller class are optional</td></tr><tr><td>Pawn / Character</td><td><code>M2_CharacterBase</code> (C++)</td><td><p>The M2 base class adds essential functionality for operation with MSquared, such as overriding the out-of-bounds behavior, which can only be done in C++.<br></p><p><em>As well as the C++ base class, we have added a barebones <code>BP_M2_PlayerCharacter</code>, which adds some minimal input and the like to get started.</em></p></td></tr><tr><td>Morpheus Actor</td><td><code>M2M_CharacterBase</code> (C++)</td><td>The M2 base class adds essential functionality for operation with MSquared, such as enabling MML avatars, and supporting animations in the crowd.<br><br><em>The class above the M2M character is <code>MorpheusPawn</code>, which is the true base class for any player controllable Morpheus Actor, but this does not support the above core MSquared functionality, which must be configured in C++.</em></td></tr></tbody></table>

### Respawning/Out-of-bounds logic

{% hint style="warning" %}
The following documentation is for release v36 onwards
{% endhint %}

One limitation of MSquared only supporting modifying Unreal assets, and not code (see [Differences from Unreal](/creation/unreal-development/getting-started/differences-in-unreal-development-workflow.md)), is that the character's "out of bounds" behavior is hidden away, and cannot typically be overridden. The default behavior of an actor when out of bounds (e.g. hitting a kill plane) is to destroy the actor. This is not compatible with typical MSquared experiences, since we pool and reuse the characters (see [Actor Pooling](/creation/unreal-development/features-and-tutorials/actor-pooling.md)).

Therefore, we have surfaced `Event Notify Outside World Bounds`, which is triggered when the character ends up out of bounds. This behavior can be overridden to implement whatever death/respawn logic etc. you want in your experience.

<figure><img src="/files/h3LcfKaz5o6zeWZkErhA" alt=""><figcaption><p>The default behavior in our base class <code>BP_M2_PlayerCharacter</code> is currently to just log a warning. We will write a fuller example behavior in future.</p></figcaption></figure>
