> For the complete documentation index, see [llms.txt](https://infinitypbr.gitbook.io/magic-pig-games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitypbr.gitbook.io/magic-pig-games/other/portrait-avatars/portrait2d.md).

# Portrait2D

Both `Portrait3D` and `Portrait2D` inherit from Portrait. As you might expect, one handles 3D portraits, while the other handles 2D portraits.

{% hint style="success" %}
`Portrait2D` should be attached to your 2D Avatar prefab. Check the Portrait Avatar 2D object in the prefabs folder for an example. Learn more about [**creating your own Portrait Avatar**](/magic-pig-games/other/portrait-avatars/setup/create-a-portrait-avatar.md).
{% endhint %}

<figure><img src="/files/iwNMEHJDCuZVgiGKiTn2" alt=""><figcaption><p>It's empty! On purpose!</p></figcaption></figure>

**Important:** The Portrait2D has no exposed values in the Inspector.

As your game is unique, I expect you may have a need for custom code. You can create your own custom class which inherits from `Portrait2D`. This means that all of the scripts which look for a `Portrait` or `Portrait2D` component will find your custom class as well, and you can add whatever functionality you'd like.

Check out the **Portrait Avatar - Demo 2D** object, in the `Portraits/Demo/Prefabs` folder. This is the 2D Avatar used in the demo scene.

The prefab also has the `Demo2DAvatarLoader` component, which handles the spawning of the actual sprite in the portrait. Your version of will do something similar, I'd imaging, but will need to be customized by you to fit your game and your needs.
