# 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="https://1456550285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoWTlPaoHd1McSakqMigu%2Fuploads%2Fgit-blob-829026b797a530b4e2978183a942410639c3c3b2%2Fimage.png?alt=media" 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](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/the-example-character "mention")
* A basic example UI setup (see [ui](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/ui "mention"))
  * 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="https://1456550285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoWTlPaoHd1McSakqMigu%2Fuploads%2Fgit-blob-b2c27a82410244c13679d1379c37639c0c19ee54%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
  * We include an example [ui-mode](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/ui/ui-mode "mention") 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](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/bots "mention"))
* An example Unreal text chat system (see [unreal-text-chat](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/communication/unreal-text-chat "mention"))
* An example Nameplate component, that displays their profile names, and their recent text chat messages (see [nameplates](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/nameplates "mention"))

  <figure><img src="https://1456550285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoWTlPaoHd1McSakqMigu%2Fuploads%2Fgit-blob-c74efb61cb0cb8cccbfcf67997183814551971b4%2Fimage.png?alt=media" alt="" width="356"><figcaption></figcaption></figure>
* Example "resizing" functionality (see [resizing](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/resizing "mention"))
* Example usage of the [kv-store-service](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/online-services/kv-store-service "mention")
* Example video player (see [example-synced-video-player](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/video-players/streaming-video-player/example-synced-video-player "mention"))
* Example "footsteps audio" (see [footsteps-audio](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/footsteps-audio "mention"))

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-in-unreal-development-workflow](https://docs.msquared.io/creation/unreal-development/getting-started/differences-in-unreal-development-workflow "mention")), 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](https://docs.msquared.io/creation/unreal-development/features-and-tutorials/actor-pooling "mention")).

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="https://1456550285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoWTlPaoHd1McSakqMigu%2Fuploads%2Fgit-blob-85502df71c63797c687415134b119b4091bd784e%2Fimage.png?alt=media" 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>
